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
= {
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',
25 ['@babel/preset-env', presetEnvOpts
],
26 ['@babel/preset-typescript'],
27 ['@babel/preset-react', { development
: !PRODUCTION
, runtime
: 'automatic' }],
30 BUILD_TARGET
!== 'safari' && DEVELOPMENT
&& require
.resolve('react-refresh/babel'),
31 PRODUCTION
&& [require
.resolve('babel-plugin-transform-react-remove-prop-types'), { removeImport
: true }],