Testing minimizing and code splitting

This commit is contained in:
2019-05-27 01:39:13 +10:00
parent a2d80c29b7
commit dffae067ab
5 changed files with 58 additions and 26 deletions
+16 -1
View File
@@ -1,3 +1,5 @@
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: './src/index.jsx',
output: {
@@ -14,10 +16,23 @@ module.exports = {
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['react-loadable/babel', '@babel/plugin-syntax-dynamic-import']
}
}
}
]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false,
},
},
})
]
}
};