如何禁用 React JS 应用程序的源映射 [英] How to disable source maps for React JS Application
本文介绍了如何禁用 React JS 应用程序的源映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的react文件夹结构如下
My react folder structure is as below
我没有使用过 create-react-app 版本.我尝试使用 GENERATE_SOURCEMAP=false
.但是没用.
I've not used the create-react-app version. I tried using GENERATE_SOURCEMAP=false
. But It didn't work.
在哪里可以找到 .map 文件.如何删除这些文件?
Where can I find the .map files. How can I delete those files?
我找不到构建文件夹.我试过使用下面的脚本,但它无法删除源映射
I cannot find a build folder. I've tried using the below script But It cannot work in removing source maps
"scripts": {
"start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=false && npm run build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
推荐答案
just remove &&
just remove &&
"scripts": {
"start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=false react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
这篇关于如何禁用 React JS 应用程序的源映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文