chore: Bundle Stats / Webpack v4 (#1448)

* chore: Experiment with bundle size monitoring service

* chore: Ensure build runs on CI, move lint and flow before test

* chore: Upgrade Webpack v3 -> v4

* chore: Add webpack-cli
Remove unused dep
Move deps to dev

* Move babel deps to production

* Move babel deps to production
This commit is contained in:
Tom Moor
2020-08-12 13:16:10 -07:00
committed by GitHub
parent 0f41a04e49
commit 11f7e3a060
8 changed files with 806 additions and 690 deletions

View File

@@ -1,13 +1,13 @@
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
commonWebpackConfig = require('./webpack.config');
productionWebpackConfig = Object.assign(commonWebpackConfig, {
cache: true,
mode: "production",
devtool: 'source-map',
entry: ['./app/index'],
output: {
@@ -19,17 +19,7 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
});
productionWebpackConfig.plugins = [
...productionWebpackConfig.plugins,
new ManifestPlugin(),
new UglifyJsPlugin({
sourceMap: true,
uglifyOptions: {
compress: true,
keep_fnames: true
}
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new ManifestPlugin()
];
module.exports = productionWebpackConfig;