-
Notifications
You must be signed in to change notification settings - Fork 169
/
webpack.mix.js
126 lines (114 loc) · 3.43 KB
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
if (mix.inProduction()) {
mix.options({
terser: {
terserOptions: {
warnings: true,
// sourceMap: true,
compress: {
warnings: false,
drop_console: true
}
}
}
});
}
mix.options({processCssUrls: false});
// enable source maps
mix.sourceMaps(false);
// less
mix.less('resources/assets/less/app.less', 'public/assets/css/app.main.css')
.less('resources/assets/less/console.less', 'public/assets/css/console.main.css')
.less('resources/assets/less/mobile.less', 'public/assets/css/mobile.main.css');
// js
mix.js('resources/assets/js/app.js', 'public/assets/js/app.main.js')
.js('resources/assets/js/console.js', 'public/assets/js/console.main.js')
.js('resources/assets/js/mobile.js', 'public/assets/js/mobile.main.js')
.extract([
'jquery', 'lodash', 'moment', 'axios',
'vue', 'vue-i18n', 'vuex', 'vue-router',
'autosize'
], 'public/assets/js/vendor');
// app styles
mix.combine([
/**
* app vendor styles
*/
// 'public/bower_components/toastr/toastr.css',
], 'public/assets/css/app.vendor.css')
.combine([
/**
* console vendor styles
*/
// 'public/bower_components/toastr/toastr.css',
], 'public/assets/css/console.vendor.css')
.combine([
/**
* mobile vendor styles
*/
// 'public/bower_components/toastr/toastr.css',
], 'public/assets/css/mobile.vendor.css');
// app scripts
mix.combine([
/**
* app vendor js
*/
// 'public/bower_components/toastr/toastr.js',
], 'public/assets/js/app.vendor.js')
.combine([
/**
* console vendor js
*/
// 'public/bower_components/toastr/toastr.js',
], 'public/assets/js/console.vendor.js')
.combine([
/**
* mobile vendor js
*/
// 'public/bower_components/toastr/toastr.js',
], 'public/assets/js/mobile.vendor.js');
// theme
mix.combine([
'public/assets/theme/app.theme.css',
], 'public/assets/css/app.theme.css')
.combine([
'public/assets/theme/app.theme.js',
], 'public/assets/js/app.theme.js');
// versions
mix.version([
'public/assets/js/vendor.js',
'public/assets/js/mobile.main.js',
'public/assets/js/console.main.js',
'public/assets/js/app.main.js',
'public/assets/css/app.main.css',
'public/assets/css/console.main.css',
'public/assets/css/mobile.main.css',
'public/assets/js/manifest.js',
'public/assets/css/app.vendor.css',
'public/assets/css/console.vendor.css',
'public/assets/css/mobile.vendor.css',
'public/assets/js/app.vendor.js',
'public/assets/js/console.vendor.js',
'public/assets/js/mobile.vendor.js',
'public/assets/css/app.theme.css',
'public/assets/js/app.theme.js',
]);
if (mix.inProduction()) {
mix.version();
}
// BrowserSync
mix.browserSync({
proxy: 'someline-starter-master.sl',
port: 3000,
open: true
})