-
Notifications
You must be signed in to change notification settings - Fork 461
/
webpack.mix.js
executable file
·67 lines (64 loc) · 2.09 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
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.
|
*/
mix.setPublicPath('public')
.setResourceRoot('../') // Turns assets paths in css relative to css file
// .options({
// processCssUrls: false,
// })
.sass('resources/sass/frontend/app.scss', 'css/frontend.css')
.sass('resources/sass/backend/app.scss', 'css/backend.css')
.js('resources/js/frontend/app.js', 'js/frontend.js')
.js([
'resources/js/backend/before.js',
'resources/js/backend/app.js',
'resources/js/backend/after.js'
], 'js/backend.js')
/* .scripts([
"public/js/backend/admin.js"
], 'public/js/backend-custom.js') */
// .copyDirectory('node_modules/tinymce/plugins', 'public/js/plugins')
// .copyDirectory('node_modules/tinymce/skins', 'public/js/skins')
// .copyDirectory('node_modules/tinymce/themes', 'public/js/themes')
// .copyDirectory('node_modules/tinymce/icons', 'public/js/icons')
.extract([
// Extract packages from node_modules to vendor.js
'jquery',
'bootstrap',
'popper.js',
'axios',
'sweetalert2',
'lodash',
'datatables.net',
'datatables.net-bs4',
'moment',
'moment-timezone',
'eonasdan-bootstrap-datetimepicker-bootstrap4beta',
'select2',
// 'tinymce'
])
.sourceMaps();
if (mix.inProduction()) {
mix.version()
.options({
// Optimize JS minification process
terser: {
cache: true,
parallel: true,
sourceMap: true
}
});
} else {
// Uses inline source-maps on development
mix.webpackConfig({
devtool: 'inline-source-map'
});
}