Fix babel options

pull/1440/head
tobspr 2 years ago
parent 2e1271ecb7
commit 197adf8120

@ -4,7 +4,14 @@ module.exports = function (api) {
[ [
"@babel/preset-env", "@babel/preset-env",
{ {
targets: "cover 99.5%", // targets: ">0.01%",
targets: {
edge: 10,
firefox: 37,
chrome: 24,
safari: 10,
ie: 10,
},
useBuiltIns: "usage", useBuiltIns: "usage",
corejs: 3, corejs: 3,
loose: true, loose: true,
@ -14,12 +21,13 @@ module.exports = function (api) {
], ],
]; ];
const plugins = [ const plugins = [
"@babel/plugin-transform-arrow-functions",
"closure-elimination", "closure-elimination",
// var is faster than let and const! // var is faster than let and const!
[ [
"@babel/plugin-transform-block-scoping", "@babel/plugin-transform-block-scoping",
{ {
throwIfClosureRequired: false, throwIfClosureRequired: true,
}, },
], ],
[ [
@ -36,6 +44,7 @@ module.exports = function (api) {
sourceType: "unambiguous", sourceType: "unambiguous",
sourceMaps: false, sourceMaps: false,
parserOpts: {}, parserOpts: {},
exclude: /(core-js|babel-core|babel-runtime)/,
generatorOpts: { generatorOpts: {
retainLines: false, retainLines: false,
compact: true, compact: true,

@ -8,8 +8,10 @@
}, },
"author": "tobspr", "author": "tobspr",
"license": "private", "license": "private",
"browserslist": "> 0.01%",
"dependencies": { "dependencies": {
"@babel/core": "^7.9.0", "@babel/core": "^7.9.0",
"@babel/plugin-transform-arrow-functions": "^7.17.12",
"@babel/plugin-transform-block-scoping": "^7.4.4", "@babel/plugin-transform-block-scoping": "^7.4.4",
"@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-classes": "^7.5.5",
"@babel/preset-env": "^7.5.4", "@babel/preset-env": "^7.5.4",

@ -8,8 +8,6 @@ const TerserPlugin = require("terser-webpack-plugin");
const StringReplacePlugin = require("string-replace-webpack-plugin"); const StringReplacePlugin = require("string-replace-webpack-plugin");
const UnusedFilesPlugin = require("unused-files-webpack-plugin").UnusedFilesWebpackPlugin; const UnusedFilesPlugin = require("unused-files-webpack-plugin").UnusedFilesWebpackPlugin;
const { checkModules, buildExcludeRegexp } = require("are-you-es5");
module.exports = ({ module.exports = ({
environment, environment,
es6 = false, es6 = false,
@ -213,7 +211,6 @@ module.exports = ({
}, },
{ {
test: /\.js$/, test: /\.js$/,
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
use: [ use: [
// "thread-loader", // "thread-loader",
{ {
@ -243,7 +240,6 @@ module.exports = ({
}, },
{ {
test: /\.worker\.js$/, test: /\.worker\.js$/,
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
use: [ use: [
{ {
loader: "worker-loader", loader: "worker-loader",

@ -144,6 +144,11 @@
resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz"
integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==
"@babel/helper-plugin-utils@^7.17.12":
version "7.17.12"
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz#86c2347da5acbf5583ba0a10aed4c9bf9da9cf96"
integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==
"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": "@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4":
version "7.5.5" version "7.5.5"
resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz" resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz"
@ -310,6 +315,13 @@
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-arrow-functions@^7.17.12":
version "7.17.12"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.17.12.tgz#dddd783b473b1b1537ef46423e3944ff24898c45"
integrity sha512-PHln3CNi/49V+mza4xMwrg+WGYevSF1oaiXaC2EQfdp4HWlSjRsrDXWJiQBKpP7749u6vQ9mcry2uuFOv5CXvA==
dependencies:
"@babel/helper-plugin-utils" "^7.17.12"
"@babel/plugin-transform-arrow-functions@^7.2.0": "@babel/plugin-transform-arrow-functions@^7.2.0":
version "7.2.0" version "7.2.0"
resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz" resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz"

Loading…
Cancel
Save