- if (mode === "none") {
- const BundleAnalyzerPlugin =
- require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
- config.plugins.push(new BundleAnalyzerPlugin());
+ const RunNodeWebpackPlugin = require("run-node-webpack-plugin");
+ serverConfig.plugins.push(
+ new RunNodeWebpackPlugin({ runOnlyInWatchMode: true })
+ );
+ } else if (mode === "none") {
+ const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
+ serverConfig.plugins.push(new BundleAnalyzerPlugin());