-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack-nomodule.config.js
More file actions
40 lines (38 loc) · 1.1 KB
/
webpack-nomodule.config.js
File metadata and controls
40 lines (38 loc) · 1.1 KB
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
const BROWSERS = ['> 1%', 'last 2 versions', 'Firefox ESR', 'not ie <= 11'];
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = (IS_DEV_SERVER) => {
return {
module: {
rules: [
{
test: /\.js$/,
// We need to transpile Polymer itself and other ES6 code
// exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: [[
'@babel/preset-env',
{
targets: { browsers: BROWSERS },
debug: true
}
]],
plugins: [
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-transform-runtime', {
'helpers': false,
'regenerator': true
}],
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }]
]
}
}
}
]
},
plugins: IS_DEV_SERVER ? [] : [
new CleanWebpackPlugin(['public'], { verbose: true })
]
};
};