build: add bundle analyzer
This commit is contained in:
@@ -4,6 +4,7 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
||||
const InlineChunkHtmlPlugin = require("react-dev-utils/InlineChunkHtmlPlugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
@@ -401,6 +402,10 @@ module.exports = function (webpackEnv) {
|
||||
].filter(Boolean)
|
||||
},
|
||||
plugins: [
|
||||
isEnvProduction &&
|
||||
new BundleAnalyzerPlugin({
|
||||
openAnalyzer: false
|
||||
}),
|
||||
// Generates an `index.html` file with the <script> injected.
|
||||
new HtmlWebpackPlugin(
|
||||
Object.assign(
|
||||
|
||||
Reference in New Issue
Block a user