2023-02-09 05:02:40 +08:00
|
|
|
module.exports = {
|
2023-06-07 18:09:34 +08:00
|
|
|
assumptions: {
|
|
|
|
// Defines assumptions Babel can make about our
|
|
|
|
// code to better optimise it.
|
|
|
|
//
|
|
|
|
// These are rarely used features that are generally
|
|
|
|
// considered very bad practice anyway.
|
|
|
|
//
|
|
|
|
// See: https://babeljs.io/docs/en/assumptions
|
|
|
|
constantSuper: true,
|
|
|
|
ignoreFunctionLength: true,
|
|
|
|
noDocumentAll: true,
|
|
|
|
noNewArrows: true,
|
|
|
|
privateFieldsAsProperties: true,
|
|
|
|
},
|
|
|
|
targets: {
|
|
|
|
// `not android > 0` means the build-in Android browser used up to Android 4.4 KitKat.
|
|
|
|
browsers: '>0.2%, not dead, not android > 0, not operamini all',
|
|
|
|
},
|
2023-02-09 05:02:40 +08:00
|
|
|
presets: [
|
|
|
|
require.resolve('@babel/preset-react'),
|
|
|
|
require.resolve('@babel/preset-typescript'),
|
|
|
|
[
|
|
|
|
require.resolve('@babel/preset-env'),
|
|
|
|
{
|
2023-06-07 18:09:34 +08:00
|
|
|
modules: 'auto',
|
2023-02-09 05:02:40 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
[require.resolve('@babel/plugin-transform-runtime'), { useESModules: true }],
|
2023-06-07 18:09:34 +08:00
|
|
|
[require.resolve('@babel/plugin-proposal-class-properties')],
|
|
|
|
[require.resolve('@babel/plugin-proposal-private-methods')],
|
2023-02-09 05:02:40 +08:00
|
|
|
[
|
|
|
|
require.resolve('@babel/plugin-transform-react-jsx'),
|
|
|
|
{
|
|
|
|
pragma: 'm',
|
|
|
|
pragmaFrag: "'['",
|
|
|
|
useBuiltIns: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|