Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / applications / pass-extension / babel.config.js
blob8ba62490139daabedc389d66e6e3abe848673905
1 /* development | production | test */
2 const ENV = process.env.NODE_ENV || 'development';
3 /* chrome | firefox | safari */
4 const BUILD_TARGET = process.env.BUILD_TARGET || 'chrome';
5 const DEVELOPMENT = ENV === 'development';
6 const PRODUCTION = ENV === 'production';
8 const presetEnvOpts = {
9 bugfixes: true,
10 corejs: '3.29',
11 exclude: [
12 'es.array.push',
13 'esnext.array-buffer.detached',
14 'esnext.array-buffer.transfer-to-fixed-length',
15 'esnext.array-buffer.transfer',
16 'transform-typeof-symbol',
17 'web.dom-exception.stack',
19 useBuiltIns: 'usage',
20 debug: false,
23 module.exports = {
24 presets: [
25 ['@babel/preset-env', presetEnvOpts],
26 ['@babel/preset-typescript'],
27 ['@babel/preset-react', { development: !PRODUCTION, runtime: 'automatic' }],
29 plugins: [
30 BUILD_TARGET !== 'safari' && DEVELOPMENT && require.resolve('react-refresh/babel'),
31 PRODUCTION && [require.resolve('babel-plugin-transform-react-remove-prop-types'), { removeImport: true }],
32 ].filter(Boolean),