2020-05-09 14:45:23 +00:00
|
|
|
module.exports = function (api) {
|
|
|
|
api.cache(true);
|
|
|
|
const presets = [
|
|
|
|
[
|
|
|
|
"@babel/preset-env",
|
|
|
|
{
|
2020-05-15 07:09:37 +00:00
|
|
|
targets: "cover 99.5%",
|
2020-05-09 14:45:23 +00:00
|
|
|
useBuiltIns: "usage",
|
|
|
|
corejs: 3,
|
|
|
|
loose: true,
|
|
|
|
spec: false,
|
|
|
|
modules: "auto",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
];
|
|
|
|
const plugins = [
|
|
|
|
"closure-elimination",
|
2020-05-15 07:09:37 +00:00
|
|
|
// var is faster than let and const!
|
|
|
|
[
|
|
|
|
"@babel/plugin-transform-block-scoping",
|
|
|
|
{
|
|
|
|
throwIfClosureRequired: false,
|
|
|
|
},
|
|
|
|
],
|
2020-05-09 14:45:23 +00:00
|
|
|
[
|
|
|
|
"@babel/plugin-transform-classes",
|
|
|
|
{
|
|
|
|
loose: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
];
|
|
|
|
return {
|
|
|
|
presets,
|
|
|
|
plugins,
|
|
|
|
highlightCode: true,
|
|
|
|
sourceType: "module",
|
|
|
|
sourceMaps: false,
|
|
|
|
parserOpts: {},
|
2022-06-16 08:35:58 +00:00
|
|
|
// only: ["../src/js"],
|
2020-05-09 14:45:23 +00:00
|
|
|
generatorOpts: {
|
|
|
|
retainLines: false,
|
|
|
|
compact: true,
|
|
|
|
minified: true,
|
|
|
|
comments: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|