Skip to content

Commit

Permalink
Refactor/#650: 웹팩 최적화 검토 (#651)
Browse files Browse the repository at this point in the history
* chore: setting json option 값 수정

* fix: 중첩 queryClient 오류 제거

* chore: eslint 설정 rule off 추가

* chore: bundle analyzer 오픈

* refactor: gzip 적용

* refactor: analyzer 사용 종료
  • Loading branch information
semnil5202 authored Feb 12, 2024
1 parent 504f52e commit 7b1c515
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 6 deletions.
2 changes: 2 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ module.exports = {
'react/no-unused-prop-types': 'off',
'no-underscore-dangle': 'off',
'default-case': 'off',
'import/no-extraneous-dependencies': 'off',
'no-dupe-keys': 'off',
},
settings: {
'import/resolver': {
Expand Down
4 changes: 2 additions & 2 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true, // eslint
"source.fixAll.stylelint": true // Stylelint
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
// formatter
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
80 changes: 77 additions & 3 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"zustand": "^4.4.3"
},
"devDependencies": {
"msw-storybook-addon": "^1.8.0",
"@babel/core": "^7.22.8",
"@babel/preset-env": "^7.22.7",
"@babel/preset-react": "^7.22.5",
Expand Down Expand Up @@ -58,6 +57,7 @@
"babel-plugin-styled-components": "^2.1.4",
"browser-image-compression": "^2.0.2",
"chromatic": "^6.19.9",
"compression-webpack-plugin": "^11.0.0",
"cypress": "^12.17.4",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.44.0",
Expand All @@ -70,6 +70,7 @@
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"msw": "^1.2.2",
"msw-storybook-addon": "^1.8.0",
"prettier": "^3.0.0",
"process": "^0.11.10",
"react-refresh": "^0.14.0",
Expand Down
12 changes: 12 additions & 0 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { ProvidePlugin, DefinePlugin } = require('webpack');
const DotenvWebpackPlugin = require('dotenv-webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const CompressionPlugin = require('compression-webpack-plugin');

module.exports = {
entry: {
Expand All @@ -27,6 +29,16 @@ module.exports = {
new DotenvWebpackPlugin({
systemvars: true,
}),
new BundleAnalyzerPlugin({
openAnalyzer: false,
}),
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8,
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js'],
Expand Down

0 comments on commit 7b1c515

Please sign in to comment.