-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
43 lines (40 loc) · 1.1 KB
/
webpack.config.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
/* eslint-env node */
'use strict'
const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: {
background: './chrome-extension/src/background.js',
popup: './chrome-extension/src/popup.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'chrome-extension/dist')
},
node: {
fs: 'empty'
},
devtool: 'cheap-source-map',
module: {
rules: [{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
mangle: {
// To avoid mangling error in `fast-srp-hap`
keep_fnames: true // eslint-disable-line camelcase
},
compress: {
// To avoid "assignment to const" error due to bad compression
unused: false
}
}
})
]
}
}