我已经使用npx create-react-app
创建了一个应用程序,我想在生产过程中删除console.log()
,但是我用Google搜索了,发现使用此链接https://babeljs.io/docs/en/babel-plugin-transform-remove-console/#via-babelrc-recommended配置的babel-plugin-transform-remove-console
插件很不幸。对我来说似乎不适合锻炼。注意,我在根目录中手动创建.babelrc文件。
答案 0 :(得分:0)
npm run eject
{
"babel": {
"presets": [
"es2015",
],
"plugins": ["transform-remove-console"]
}
}
npm run build