add BundleAnalyzerPlugin (optional)

This commit is contained in:
Proddy
2023-02-07 21:30:22 +01:00
parent a4d31711a0
commit 949842118b

View File

@@ -3,6 +3,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ProgmemGenerator = require('./progmem-generator.js');
const TerserPlugin = require('terser-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = function override(config, env) {
const hosted = process.env.REACT_APP_HOSTED;
@@ -23,8 +25,14 @@ module.exports = function override(config, env) {
const terserPlugin = config.optimization.minimizer.find((plugin) => plugin instanceof TerserPlugin);
terserPlugin.options.extractComments = false;
// create size map
// config.plugins.push(new BundleAnalyzerPlugin());
// build progmem data files
config.plugins.push(new ProgmemGenerator({ outputPath: '../lib/framework/WWWData.h', bytesPerLine: 20 }));
}
return config;
};