-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.minify.js
37 lines (35 loc) · 1005 Bytes
/
webpack.config.minify.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
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
module.exports = {
target: 'web',
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'aframe-lsystem-component.min.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
babelrc: true
}
}
},
]
},
plugins: [
new UglifyJSPlugin({
sourceMap: true,
uglifyOptions: {
compress: {dead_code: true, conditionals: true, evaluate: true, loops: true, unused: true, reduce_vars: true, passes: 1, hoist_funs: true, hoist_vars: true, inline: true, keep_fargs: false, unsafe: true, comparisons: true, unsafe_comps: true},
mangle: {keep_fnames: false, reserved: ['LSystem', 'LSystemWorker', 'worker'], toplevel: true},
ie8: false
}
})
],
};