mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-03 05:50:25 +08:00
44 lines
979 B
JavaScript
44 lines
979 B
JavaScript
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()]
|