-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.mix.js
52 lines (47 loc) · 1.36 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
const mix = require('laravel-mix');
Mix.manifest.refresh = _ => void 0
const devUrl = 'formality.local';
require('laravel-mix-copy-watched');
require('laravel-mix-banner');
mix
.setPublicPath('./dist')
.browserSync(devUrl);
mix
.sass('assets/styles/public/index.scss', 'styles/formality-public.css')
.sass('assets/styles/admin/index.scss', 'styles/formality-admin.css');
mix
.js('assets/scripts/public/index.js', 'scripts/formality-public.js')
.js('assets/scripts/editor/index.js', 'scripts/formality-editor.js')
.js('assets/scripts/admin/index.js', 'scripts/formality-admin.js')
.banner({ banner: 'Formality v1.5.7' });
mix
.copyWatched('assets/images/admin/**', 'dist/images/admin')
.copyWatched('assets/images/templates.json', 'dist/images')
.copyWatched('assets/images/logo.svg', 'dist/images')
.copyWatched([
'assets/fonts/*.woff',
'assets/fonts/*.woff2'
], 'dist/fonts');
mix
.webpackConfig({
externals: {
wp: 'wp',
react: 'React',
'react-dom': 'ReactDOM',
lodash: 'lodash',
},
})
.options({
processCssUrls: false,
terser: {
terserOptions: {
mangle: { reserved: ['__'] },
output: {
comments ({}, { value }) { return value.startsWith("! Formality v") }
}
},
extractComments: false
}
})
.sourceMaps(false, 'source-map')
.version();