[英]Create React App(npm run build) generates chunk.js file with unwanted content of package.json
I have a security issue with that because my *.chunk.js
file contains content of package.json
file + expected js
code of course.我有一个安全问题,因为我的
*.chunk.js
文件当然包含package.json
文件的内容 + 预期的js
代码。 How i can get rid of that package.json
content?我怎样才能摆脱那个
package.json
内容?
I'm running default set of CRA2 with我正在运行默认的 CRA2 集
"build-js": "react-scripts build",
"build": "npm-run-all build-js"
As discussed on the comments the issue was import of package.json on the App.js file.正如评论中所讨论的,问题是在 App.js 文件中导入 package.json。
So while building it has added the package.json file data on the chunk.js所以在构建它的时候已经在 chunk.js 上添加了 package.json 文件数据
Removing the import of package.json solved the issue.删除 package.json 的导入解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.