Update babel config (#10855)
This commit is contained in:
1 parent
e161350309
commit
2eb2df6ed2
3 files changed
+10
-11
No files matched your search
+1
-1
@@ -149,7 +149,7 @@
|
||||
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
|
||||
"lint:changelog": "node ./scripts/lint-changelog.js",
|
||||
"lint:prettier": "prettier . \"!test*\" --check",
|
||||
"lint:dist": "eslint --no-eslintrc --no-ignore --no-inline-config --env=es6,browser --parser-options=ecmaVersion:2018 \"dist/!(bin-prettier|index|third-party).js\"",
|
||||
"lint:dist": "eslint --no-eslintrc --no-ignore --no-inline-config --env=es6,browser --parser-options=ecmaVersion:2019 \"dist/!(bin-prettier|index|third-party).js\"",
|
||||
"lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
|
||||
"lint:deps": "node ./scripts/check-deps.js",
|
||||
"fix": "run-s fix:eslint fix:prettier",
|
||||
|
||||
@@ -22,7 +22,7 @@ process.on("unhandledRejection", (err) => {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
const CACHE_VERSION = "v33"; // This need update when updating build scripts
|
||||
const CACHE_VERSION = "v34"; // This need update when updating build scripts
|
||||
const statusConfig = [
|
||||
{ color: "bgYellow", text: "CACHED" },
|
||||
{ color: "bgGreen", text: "DONE" },
|
||||
|
||||
@@ -83,6 +83,9 @@ function webpackNativeShims(config, modules) {
|
||||
function getBabelConfig(bundle) {
|
||||
const config = {
|
||||
babelrc: false,
|
||||
assumptions: {
|
||||
setSpreadProperties: true,
|
||||
},
|
||||
sourceType: "unambiguous",
|
||||
plugins: bundle.babelPlugins || [],
|
||||
compact: bundle.type === "plugin" ? false : "auto",
|
||||
@@ -104,7 +107,7 @@ function getBabelConfig(bundle) {
|
||||
}
|
||||
config.presets = [
|
||||
[
|
||||
require.resolve("@babel/preset-env"),
|
||||
"@babel/preset-env",
|
||||
{
|
||||
targets,
|
||||
exclude: [
|
||||
@@ -114,7 +117,6 @@ function getBabelConfig(bundle) {
|
||||
"es.string.replace",
|
||||
"es.symbol.description",
|
||||
"es.typed-array.*",
|
||||
"transform-async-to-generator",
|
||||
"web.*",
|
||||
],
|
||||
modules: false,
|
||||
@@ -126,13 +128,10 @@ function getBabelConfig(bundle) {
|
||||
},
|
||||
],
|
||||
];
|
||||
config.plugins.push(
|
||||
[
|
||||
require.resolve("@babel/plugin-proposal-object-rest-spread"),
|
||||
{ loose: true, useBuiltIns: true },
|
||||
],
|
||||
require.resolve("@babel/plugin-proposal-optional-catch-binding")
|
||||
);
|
||||
config.plugins.push([
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
{ useBuiltIns: true },
|
||||
]);
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user