forked from officelifehq/officelife
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
33 lines (30 loc) · 1.08 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
const mix = require('laravel-mix');
const path = require('path');
require('laravel-mix-purgecss');
const purgeCssOptions = {
safelist: {
// List of regex of CSS class to not remove
standard: [/^ball-pulse/, /^ball-clip-rotate/, /^vs__/, /^dot-/, /^expense-badge-/, /^timesheet-badge-/, /^failed/],
// List of regex of CSS class name whose child path CSS class will not be removed
// ex: to exclude "jane" in "mary jane": add "mary")
deep: [/^vue-loaders/, /^vs-/, /^ant-/, /^vc-/],
}
};
mix.js('resources/js/app.js', 'public/js').vue()
.sass('resources/sass/app.scss', 'public/css')
.purgeCss(purgeCssOptions)
.webpackConfig({
output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
})
.alias({
vue$: path.join(__dirname, 'node_modules/vue/dist/vue.esm-bundler.js'),
'@': path.resolve('resources/js'),
})
.babelConfig({
plugins: ['@babel/plugin-syntax-dynamic-import'],
})
.sourceMaps(process.env.MIX_PROD_SOURCE_MAPS || false, 'eval-cheap-module-source-map', 'source-map')
.setResourceRoot('../');
if (mix.inProduction()) {
mix.version();
}