Skip to content

Instantly share code, notes, and snippets.

@huang-xiao-jian
Last active August 18, 2019 08:25
Show Gist options
  • Save huang-xiao-jian/f6e3cd3f15eb78253a4a910585e201ea to your computer and use it in GitHub Desktop.
Save huang-xiao-jian/f6e3cd3f15eb78253a4a910585e201ea to your computer and use it in GitHub Desktop.
babel shared configuration.
{
"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