Removing propTypes in production build
文章目录
Removing propTypes in production build? #209
1.安装
npm install --save-dev babel-plugin-transform-react-remove-prop-types2.配置使用
在.babelrc文件中:
"env": {
"production": {
"plugins": [
["transform-react-remove-prop-types",
{"mode":"remove",
"removeImport": true,
"ignoreFilenames":["node_modules"]}
]
]
}
}- mode: 清除
prop-types生成的代码 - removeImport: 清除
import引入的代码 - ignoreFilenames: 忽略
node_modules中的代码
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论