-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor/#650: 웹팩 최적화 검토 #651
Changes from all commits
dff71b2
e897eec
9c63956
c09d286
053fe0d
5fd5a9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
@@ -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", | ||
|
@@ -70,6 +70,7 @@ | |
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.2", | ||
"msw": "^1.2.2", | ||
"msw-storybook-addon": "^1.8.0", | ||
Comment on lines
72
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. msw끼리 모아둔 꼼꼼함 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 옷~ 이건 의도하지 않았는데 npm i 하면서 자동 정렬된거 같군영~ |
||
"prettier": "^3.0.0", | ||
"process": "^0.11.10", | ||
"react-refresh": "^0.14.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: { | ||
|
@@ -27,6 +29,16 @@ module.exports = { | |
new DotenvWebpackPlugin({ | ||
systemvars: true, | ||
}), | ||
new BundleAnalyzerPlugin({ | ||
openAnalyzer: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 확인하고 바로 false하는 꼼꼼함 멋지네요ㅋㅋㅋㅋㅋㅋ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋ run dev 할때마다 창 두 개 뜨는게 조큼 별로라.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍👍👍 |
||
}), | ||
new CompressionPlugin({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 클라우드프론트하는것보다 훨씬 간단하네여 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 성능적인 부분까지는 파악하지 못했네요. 아마 압축 알고리즘이 gzip으로 동일해서 성능은 동일하지 않나.. 추측해봅니다. 이 글에 의하면 클라운드 프론트에서는 압축 실행, 해제 이정도 단위로 수행할 수 있는 것 같은데 웹팩에서는 조금 더 상세한 설정이 가능했습니다. threshold : 설정한 크기 보다 큰 것만 압축 수행 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cloudFront를 못 써서 gzip이 안된다는걸 간과했는데 세인이 잘 짚어주신 것 같습니다!! 그런데 혹시 아이크가 말한 '핑프' << 는 무엇일까요?!!! 줄임말에 넘나 약해서... ㅎㅎㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋㅋㅋㅋ핑프란 핑거프린세스로 직역하면 공주님 손가락인데 보통 의미는 무언가를 찾지 않고 남에게만 물어보는 (귀찮아서) 그런 사람을 지칭하는 말입니다. 근데 원래 리뷰라는게 남이 아는걸 질문해서 빠르게 알아가는 장점도 있는거져~ |
||
filename: '[path][base].gz', | ||
algorithm: 'gzip', | ||
test: /\.js$|\.css$|\.html$/, | ||
threshold: 10240, | ||
minRatio: 0.8, | ||
}), | ||
], | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.jsx', '.js'], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호 이 라이브러리를 이용해 gzip을 적용할 수 있군요!! 👍