加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
babel.config.js 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
zhangsheng 提交于 2021-03-15 14:16 . init 初始化
module.exports = {
ignore: [
/[\\\/]core-js/,
/webpack[\\\/]buildin/
],
overrides: [{
test: "./node_modules",
}],
sourceType: "unambiguous",
presets: [
[
'@babel/preset-env',
{
modules: false,
useBuiltIns: 'usage',
corejs: {
version: 3,
proposals: true
},
targets: {
"chrome": 58,
"ie": 11
}
}
],
'@babel/preset-react',
'@babel/preset-typescript'
],
plugins: [
'react-hot-loader/babel',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
["import", {
"libraryName": "antd",
"libraryDirectory": "es",
"style": true
}],
["transform-imports", {
"react-router": {
"transform": "react-router/${member}",
"preventFullImport": true
},
"lodash": {
"transform": "lodash/${member}",
"preventFullImport": true
}
}]
],
env: {
production: {
only: ['app', 'libs', 'share'],
plugins: [
'lodash',
'transform-react-remove-prop-types',
// '@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements'
]
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node'
]
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化