subspace/packages/react/babel.config.js

95 lines
2.5 KiB
JavaScript
Raw Normal View History

module.exports = api => {
api.cache(true);
return {
env: {
2020-04-03 18:07:30 +00:00
node: {
presets: [
[
"@babel/preset-env",
{
corejs: 3,
shippedProposals: true,
targets: {node: "current"},
useBuiltIns: "usage"
}
]
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
corejs: 3
}
],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-react-jsx"
]
},
browser: {
presets: [
[
"@babel/preset-env",
{
corejs: 3,
modules: false,
shippedProposals: true,
targets: {browsers: "defaults"},
useBuiltIns: "usage"
}
]
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
corejs: 3,
useESModules: true
}
],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-react-jsx"
]
},
module: {
presets: [
[
"@babel/preset-env",
{
corejs: 3,
modules: false,
shippedProposals: true,
targets: {node: "current"},
useBuiltIns: "usage"
}
]
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
corejs: 3,
useESModules: true
}
],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-react-jsx"
]
}
},
sourceMaps: true
};
};