forked from michelegiorgi/formality
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
45 lines (40 loc) · 1.14 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
Mix.manifest.refresh = _ => void 0
const mix = require('laravel-mix');
const devUrl = 'formality.local';
require('laravel-mix-copy-watched');
mix
.setPublicPath('./dist')
.browserSync(devUrl);
mix
.sass('assets/styles/public.scss', 'styles/formality-public.css')
.sass('assets/styles/admin.scss', 'styles/formality-admin.css')
mix
.js('assets/scripts/public.js', 'scripts/formality-public.js')
.js('assets/scripts/editor.js', 'scripts/formality-editor.js')
.js('assets/scripts/admin.js', 'scripts/formality-admin.js')
mix
.copyWatched('assets/images/admin/**', 'dist/images/admin')
.copyWatched('assets/images/templates.json', 'dist/images')
.copyWatched([
'assets/fonts/*.otf',
'assets/fonts/*.ttf',
'assets/fonts/*.woff',
'assets/fonts/*.woff2'
], 'dist/fonts');
mix
.webpackConfig({
externals: {
wp: 'wp',
react: 'React',
jquery: 'jQuery',
'react-dom': 'ReactDOM',
lodash: 'lodash',
},
})
.autoload({ jquery: ['$', 'window.jQuery'] })
.options({
processCssUrls: false,
terser: { extractComments: false }
})
.sourceMaps(false, 'source-map')
.version();