Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] 깃허브 워크플로우에서 webpack-bundle-analyzer가 실행됐던 문제 해결 #378

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"scripts": {
"prod": "webpack server --open --config webpack.prod.js",
"dev": "webpack server --open --config webpack.dev.js",
"build:prod": "NODE_ENV=production webpack --config webpack.prod.js && npm run sentry:sourcemaps",
"build:dev": "NODE_ENV=production webpack --config webpack.prod.js",
"build:prod-analyzer": "NODE_ENV=production USE_BUNDLE_ANALYZER=true webpack --config webpack.prod.js && npm run sentry:sourcemaps",
"build:prod": "NODE_ENV=production USE_BUNDLE_ANALYZER=false webpack --config webpack.prod.js && npm run sentry:sourcemaps",
"build:dev-analyzer": "NODE_ENV=production USE_BUNDLE_ANALYZER=true webpack --config webpack.prod.js && npm run sentry:sourcemaps",
"build:dev": "NODE_ENV=production USE_BUNDLE_ANALYZER=false webpack --config webpack.prod.js",
"sentry:sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload -o momo2024 -p momo-harry-test /dist",
"lint:css": "stylelint '**/*.styles.ts' --fix",
"test": "jest",
Expand Down
10 changes: 6 additions & 4 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const DotenvWebpackPlugin = require('dotenv-webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const FontPreloadPlugin = require('webpack-font-preload-plugin');

const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

const bundleAnalyzer =
process.env.USE_BUNDLE_ANALYZER === 'true' ? new BundleAnalyzerPlugin() : null;

module.exports = () => ({
entry: './src/index.tsx',
Expand Down Expand Up @@ -88,12 +90,12 @@ module.exports = () => ({
// ? hidden-source-map을 사용해야 삭제가 되는 것인지는 아직 모름.
},
}),
new BundleAnalyzerPlugin(),
new FontPreloadPlugin({
index: 'index.html',
extensions: ['woff2'],
}),
],
bundleAnalyzer,
].filter(Boolean),

devtool: 'source-map',

Expand Down