Last active
August 18, 2019 08:25
-
-
Save huang-xiao-jian/f6e3cd3f15eb78253a4a910585e201ea to your computer and use it in GitHub Desktop.
babel shared configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"modules": false, | |
"loose": true | |
} | |
], | |
"@babel/preset-react" | |
], | |
"plugins": [ | |
"@babel/plugin-proposal-class-properties", | |
"@babel/plugin-transform-regenerator", | |
"@babel/plugin-syntax-dynamic-import", | |
"@babel/plugin-syntax-import-meta", | |
"@babel/plugin-proposal-json-strings", | |
[ | |
"import", | |
{ | |
"libraryName": "antd", | |
"libraryDirectory": "es", | |
"style": "css" | |
} | |
] | |
], | |
"env": { | |
"development": { | |
"plugins": [ | |
"react-hot-loader/babel" | |
] | |
}, | |
"production": { | |
"plugins": [ | |
"@coco-platform/babel-plugin-import-css-module", | |
[ | |
"@babel/plugin-transform-runtime", | |
{ | |
"helpers": true, | |
"corejs": 3 | |
} | |
] | |
] | |
}, | |
"test": { | |
"plugins": [ | |
"@babel/plugin-transform-modules-commonjs" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment