2018-11-08 22:37:12 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const presets = [
|
|
|
|
[
|
|
|
|
'@babel/preset-env',
|
|
|
|
{
|
|
|
|
modules: false,
|
2019-03-12 23:48:37 +08:00
|
|
|
// see also zloirock/core-js https://bit.ly/2JLnrgw
|
|
|
|
useBuiltIns: 'entry',
|
2019-05-27 23:03:21 +08:00
|
|
|
corejs: 3
|
2018-11-08 22:37:12 +08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
'@babel/preset-react'
|
|
|
|
];
|
|
|
|
|
|
|
|
const plugins = [
|
2018-12-24 23:57:03 +08:00
|
|
|
'react-hot-loader/babel',
|
2018-11-08 22:37:12 +08:00
|
|
|
[
|
|
|
|
'@babel/plugin-transform-runtime',
|
|
|
|
{
|
|
|
|
corejs: false,
|
|
|
|
helpers: true,
|
|
|
|
regenerator: true,
|
|
|
|
useESModules: true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'@babel/plugin-syntax-dynamic-import',
|
|
|
|
'@babel/plugin-proposal-class-properties',
|
|
|
|
'@babel/plugin-proposal-do-expressions'
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = api => {
|
|
|
|
api.cache(true);
|
|
|
|
return { presets, plugins };
|
|
|
|
};
|