React App 빌드시 sourcemap 파일 제외하기
https://github.com/facebook/create-react-app/issues/2005
I figured it out. Looks like we have to eject to disable the source maps inside of our production webpack config. Steps are outlined below..
1. Eject your create-react-app by running npm run eject
2. Open /config/webpack.config.prod.js
3. Remove or comment out line 53 containing devtool: 'source-map',
4. Build, and deploy your app again
설정 변경
// /config/webpack.config.prod.js : 57 줄
// Source maps are resource heavy and can cause out of memory issue for large source files.
// devtool: shouldUseSourceMap ? "source-map" : false,
devtool: false,
이 후 build 시 *.map
파일이 제외됩니다.
tags: javascript, react, build, sourcemap
'Programming > JavaScript' 카테고리의 다른 글
[책] 빠른 모바일 앱 개발을 위한 React Native (0) | 2018.05.16 |
---|---|
[책] Learning React (0) | 2018.04.25 |
React App Github Deploy (0) | 2018.04.21 |
firestore & storage 사용하기 (0) | 2018.04.20 |
[React.JS] 작업환경 설정하는 중 에러 (1) | 2018.01.26 |
댓글