-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.mix.js
58 lines (52 loc) · 1.65 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
/**
* This file sets up the compilation of JS and SASS for the project using Laravel Mix. That is a
* framework built on top of Webpack, greatly simplifying doing the same thing in vanilla Webpack.
*
* Use `npm run dev` to compile once
* Use `npm run watch` to watch the files, compile, and refresh the proxy below
* Use `npm run production` to compile the files for production
*
* @link https://github.com/JeffreyWay/laravel-mix/tree/master/docs
*/
const mix = require('laravel-mix');
var LiveReloadPlugin = require('webpack-livereload-plugin');
// Setup asset compilation
mix
.js('assets/js/front-scripts.js', 'assets/dist/')
.js('assets/js/admin-scripts.js', 'assets/dist/')
.sass('assets/scss/style.scss', 'assets/dist/')
.sass('assets/scss/admin.scss', 'assets/dist/')
.options({
processCssUrls: false
});
// Refresh the browser at the following domain when files change
mix.browserSync({
proxy: 'http://theme-boilerplate.local/',
files: [
'**/*.php',
'style.css',
'dist/app.js',
],
open: false,
notify: false,
});
// Load jQuery into every script and resolve package aliases
mix.autoload({
jQuery: ['$', 'window.jQuery'],
})
.webpackConfig({
externals: {
jQuery: 'jQuery',
jquery: 'jQuery'
},
resolve: {
alias: {
'handlebars': 'handlebars/dist/handlebars.js',
'select2-css': 'select2/dist/css/select2.min.css',
'flatpickr-css': 'flatpickr/dist/flatpickr.min.css',
}
},
plugins: [
new LiveReloadPlugin()
]
});