From 4f426638b26e5acadfb9d84f8295ffc0dd7f20af Mon Sep 17 00:00:00 2001 From: Ashley Heo <51967731+ashleysyheo@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:16:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20npm=20run=20build=20=EC=8B=9C=20?= =?UTF-8?q?=EC=98=A4=EB=9E=98=20=EA=B1=B8=EB=A6=AC=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20(#549)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 3 ++- frontend/webpack.config.js | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 60be48b5d..c18aba5f3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,7 +29,8 @@ "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "lint": "eslint src", - "cypress": "cypress open" + "cypress": "cypress open", + "analyze": "webpack-bundle-analyzer ./dist/bundle-report.json --default-sizes gzip" }, "keywords": [], "author": "", diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index c04f79ad0..da59009e8 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -18,7 +18,13 @@ const plugins = [ }), new webpack.HotModuleReplacementPlugin(), new Dotenv(), - new BundleAnalyzerPlugin(), + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + openAnalyzer: false, + generateStatsFile: true, + statsFilename: 'bundle-report.json', + }), + new CompressionPlugin(), ]; @@ -97,6 +103,7 @@ module.exports = { '@utils': path.resolve(__dirname, './src/utils'), }, }, + plugins, optimization: {