Generate reports when we deploy

This commit is contained in:
Jordan Eldredge 2018-08-29 20:36:14 -07:00
parent 3b9eb810cb
commit c0e72ab31a
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,7 @@
const path = require("path");
const webpack = require("webpack");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
node: {
@ -40,6 +41,11 @@ module.exports = {
noParse: [/jszip\.js$/]
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "library-report.html",
openAnalyzer: false
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")

View File

@ -3,6 +3,8 @@ const merge = require("webpack-merge");
const workboxPlugin = require("workbox-webpack-plugin");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const common = require("./webpack.common.js");
const gitRevisionPlugin = new GitRevisionPlugin();
@ -10,6 +12,11 @@ const gitRevisionPlugin = new GitRevisionPlugin();
const config = merge(common, {
devtool: "source-map",
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "prod-report.html",
openAnalyzer: false
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")