uppy/babel.config.js
2022-08-16 22:39:28 +02:00

28 lines
856 B
JavaScript

module.exports = (api) => {
const targets = {}
if (api.env('test')) {
targets.node = 'current'
}
return {
presets: [
['@babel/preset-env', {
include: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-numeric-separator',
],
loose: true,
targets,
useBuiltIns: false, // Don't add polyfills automatically.
// We can uncomment the following line if we start adding polyfills to the non-legacy dist files.
// corejs: { version: '3.24', proposals: true },
modules: false,
}],
],
plugins: [
['@babel/plugin-transform-react-jsx', { pragma: 'h' }],
process.env.NODE_ENV !== 'dev' && 'babel-plugin-inline-package-json',
].filter(Boolean),
}
}