본문 바로가기
Programming/JavaScript

React App 빌드시 sourcemap 파일 제외하기

by NAMP 2018. 4. 22.

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

댓글