Use static Babel config file
This commit is contained in:
parent
9871e2e484
commit
a43e8036c5
@ -1,43 +0,0 @@
|
||||
module.exports = api => ({
|
||||
production: {
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
useBuiltIns: false,
|
||||
loose: true,
|
||||
}],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
['@babel/plugin-transform-runtime', {
|
||||
helpers: true,
|
||||
regenerator: true,
|
||||
}],
|
||||
'@babel/plugin-proposal-optional-catch-binding',
|
||||
],
|
||||
},
|
||||
development: {
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
targets: { esmodules: true },
|
||||
}],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'@babel/plugin-proposal-optional-catch-binding',
|
||||
],
|
||||
},
|
||||
test: {
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
targets: { node: 'current' },
|
||||
}],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: [
|
||||
'babel-plugin-dynamic-import-node',
|
||||
'@babel/plugin-proposal-optional-catch-binding',
|
||||
],
|
||||
},
|
||||
})[api.env()]
|
55
babel.config.json
Normal file
55
babel.config.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/preset-typescript"
|
||||
],
|
||||
"plugins": [],
|
||||
"env": {
|
||||
"production": {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"useBuiltIns": false,
|
||||
"loose": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@babel/plugin-transform-runtime",
|
||||
{
|
||||
"helpers": true,
|
||||
"regenerator": true
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"development": {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"esmodules": true
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"test": {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"babel-plugin-dynamic-import-node"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user