CRA로 앱을 만들었으면 react-scripts@>=3.2.0가 내장되어 있을텐데, 그러면 다음의 명령어로 원하는 바를 이룰 수 있다.
$ npx react-scripts build --profile
난독화 해제하기
minify 하면서 함수 이름, 변수명 등 많이 변경돼서 파악하기 어려우므로 이름을 유지하도록 설정 변경
// ... some config ...
new TerserPlugin({
terserOptions: {
// ... some other config ...
mangle: {
safari10: true,
},
keep_classnames: true,
keep_fnames: true,
// ... some more config ...
},
// ... even more config ...
})