42 строки
1.3 KiB
JavaScript
42 строки
1.3 KiB
JavaScript
|
module.exports = {
|
||
|
// https://babeljs.io/docs/en/assumptions
|
||
|
'assumptions': {
|
||
|
'setPublicClassFields': true,
|
||
|
},
|
||
|
'presets': [
|
||
|
[
|
||
|
// https://babeljs.io/docs/en/babel-preset-env
|
||
|
'@babel/preset-env',
|
||
|
{
|
||
|
// Allow `@babel/preset-env` to import polyfills from core-js as needed.
|
||
|
'useBuiltIns': 'usage',
|
||
|
// Help `@babel/preset-env` make use of the correct core-js polyfills.
|
||
|
'corejs': '3.23',
|
||
|
// Perform transforms closest to targets defined in `.browserslistrc`.
|
||
|
'bugfixes': true,
|
||
|
},
|
||
|
],
|
||
|
'@babel/preset-flow',
|
||
|
// https://babeljs.io/docs/en/babel-preset-react/
|
||
|
[
|
||
|
'@babel/preset-react',
|
||
|
{
|
||
|
// When spreading props, use inline object with spread elements directly
|
||
|
// instead of Babel's extend helper or Object.assign.
|
||
|
'useBuiltIns': true,
|
||
|
// FIXME: Upgrade to React 17+
|
||
|
// Cannot use React 17 new, lighter, faster JSX Transform
|
||
|
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
|
||
|
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#motivation
|
||
|
// 'runtime': 'automatic',
|
||
|
},
|
||
|
],
|
||
|
],
|
||
|
'plugins': [],
|
||
|
'env': {
|
||
|
'test': {
|
||
|
'plugins': ['dynamic-import-node'],
|
||
|
},
|
||
|
},
|
||
|
};
|