uppy/babel.config.js
Antoine du Hamel 848aa858e1
meta: replace browserify with esbuild (#3363)
* meta: build bundle using esbuild

* meta: don't use terser to build minified bundle

* website: use esbuild instead of browserify

* remove disc and disc.html

* Update lock file

* Simplify inject script

* nits

* fix `yarn start`
2022-01-13 15:22:01 +01: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.15', proposals: true },
modules: false,
}],
],
plugins: [
['@babel/plugin-transform-react-jsx', { pragma: 'h' }],
process.env.NODE_ENV !== 'dev' && 'babel-plugin-inline-package-json',
].filter(Boolean),
}
}