1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00
tobspr_shapez.io/gulp/babel.config.js

56 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-05-09 14:45:23 +00:00
module.exports = function (api) {
api.cache(true);
const presets = [
[
"@babel/preset-env",
{
2022-06-16 09:58:49 +00:00
// targets: ">0.01%",
targets: {
edge: 10,
firefox: 37,
chrome: 24,
safari: 10,
ie: 10,
},
2020-05-09 14:45:23 +00:00
useBuiltIns: "usage",
corejs: 3,
loose: true,
spec: false,
modules: "auto",
},
],
];
const plugins = [
2022-06-16 09:58:49 +00:00
"@babel/plugin-transform-arrow-functions",
2022-06-16 09:28:37 +00:00
"closure-elimination",
2020-05-15 07:09:37 +00:00
// var is faster than let and const!
2022-06-16 10:04:59 +00:00
// [
// "@babel/plugin-transform-block-scoping",
// {
// throwIfClosureRequired: true,
// },
// ],
2020-05-09 14:45:23 +00:00
[
"@babel/plugin-transform-classes",
{
2022-06-16 09:28:37 +00:00
loose: true,
2020-05-09 14:45:23 +00:00
},
],
];
return {
presets,
plugins,
highlightCode: true,
2022-06-16 09:28:37 +00:00
sourceType: "unambiguous",
2020-05-09 14:45:23 +00:00
sourceMaps: false,
parserOpts: {},
2022-06-16 09:58:49 +00:00
exclude: /(core-js|babel-core|babel-runtime)/,
2020-05-09 14:45:23 +00:00
generatorOpts: {
retainLines: false,
compact: true,
minified: true,
comments: true,
},
};
};