-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.mix.js
51 lines (42 loc) · 931 Bytes
/
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
const mix = require('laravel-mix');
const DependencyExtractionWebpackPlugin = require(
'@wordpress/dependency-extraction-webpack-plugin'
);
/**
* The externals library.
*
* @type {Object}
*/
const externals = {};
mix.sass('resources/scss/admin.scss', 'dist/');
mix.js('resources/js/checkout.js', 'dist/');
mix.js('resources/js/edit-order.js', 'dist/').vue();
mix.sourceMaps(false, 'source-map');
if (mix.inProduction()) {
mix.version();
}
mix.setPublicPath('./');
mix.disableSuccessNotifications();
mix.browserSync({
proxy: process.env.MIX_BROWSER_SYNC_URL || 'http://wp.local',
files: ['dist/*.js', 'dist/*.css']
});
mix.webpackConfig({
externals,
output: {
libraryTarget: 'window'
},
plugins: [
new DependencyExtractionWebpackPlugin()
]
});
mix.options({
processCssUrls: false,
hmrOptions: {
host: 'localhost',
port: 8889
},
fileLoaderDirs: {
images: 'dist/img'
}
});