-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack-nomodule.config.js
41 lines (39 loc) · 1.09 KB
/
webpack-nomodule.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
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: [[
'env',
{
targets: {browsers: BROWSERS},
debug: true
}
]],
plugins: [
'babel-plugin-syntax-dynamic-import',
['transform-runtime', {
'helpers': false,
'polyfill': false,
'regenerator': true
}],
['transform-object-rest-spread', {useBuiltIns: true}]
]
}
}
}
]
},
plugins: IS_DEV_SERVER ? [] : [
new CleanWebpackPlugin(['public'], {verbose: true})
]
};
};