[英]how to remove console.log during production in reactjs created with `create-react-app`
i have create app using npx create-react-app
i want to remove console.log()
during production but i googled i found this babel-plugin-transform-remove-console
plugin configured using this link https://babeljs.io/docs/en/babel-plugin-transform-remove-console/#via-babelrc-recommended unfortunatly it does't seem workout for me.我已经使用 npx
create-react-app
我想在生产过程中删除console.log()
但我用谷歌搜索我发现这个babel-plugin-transform-remove-console
插件是使用这个链接配置的https://babeljs.io/ docs/en/babel-plugin-transform-remove-console/#via-babelrc-recommended不幸的是,它对我来说似乎没有锻炼。 Note i create.babelrc file manually in my root dir.注意我在我的根目录中手动创建 .babelrc 文件。
npm run eject
npm run eject
"babel": { "presets": [ "react-app" ], "env": { "production": { "plugins": [ "transform-remove-console" ] } } }
npm run build
npm run build
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.