Skip to content

Commit

Permalink
chore: do not provide polyfills on bundling @babel/standalone (#12909)
Browse files Browse the repository at this point in the history
* chore: do not provide polyfills on bundling @babel/standalone

* review from Nicol貌

* chore: update @babel/helper-define-polyfill-provider
  • Loading branch information
JLHwung committed Feb 26, 2021
1 parent cf7860f commit bfd30b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
14 changes: 11 additions & 3 deletions babel.config.js
Expand Up @@ -75,8 +75,16 @@ module.exports = function (api) {
// Configs used during bundling builds.
case "standalone":
includeRegeneratorRuntime = true;
unambiguousSources.push("packages/babel-runtime/regenerator");
// fall through
convertESM = false;
ignoreLib = false;
// rollup-commonjs will converts node_modules to ESM
unambiguousSources.push(
"/**/node_modules",
"packages/babel-preset-env/data",
"packages/babel-compat-data",
"packages/babel-runtime/regenerator"
);
break;
case "rollup":
convertESM = false;
ignoreLib = false;
Expand All @@ -86,7 +94,7 @@ module.exports = function (api) {
"packages/babel-preset-env/data",
"packages/babel-compat-data"
);
if (env === "rollup") targets = { node: nodeVersion };
targets = { node: nodeVersion };
needsPolyfillsForOldNode = true;
break;
case "test-legacy": // In test-legacy environment, we build babel on latest node but test on minimum supported legacy versions
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Expand Up @@ -375,7 +375,7 @@ __metadata:
languageName: unknown
linkType: soft

"@babel/helper-compilation-targets@npm:^7.10.4, @babel/helper-compilation-targets@npm:^7.13.0":
"@babel/helper-compilation-targets@npm:^7.13.0":
version: 7.13.0
resolution: "@babel/helper-compilation-targets@npm:7.13.0"
dependencies:
Expand Down Expand Up @@ -471,20 +471,20 @@ __metadata:
linkType: soft

"@babel/helper-define-polyfill-provider@npm:^0.1.1":
version: 0.1.1
resolution: "@babel/helper-define-polyfill-provider@npm:0.1.1"
version: 0.1.4
resolution: "@babel/helper-define-polyfill-provider@npm:0.1.4"
dependencies:
"@babel/helper-compilation-targets": ^7.10.4
"@babel/helper-module-imports": ^7.10.4
"@babel/helper-plugin-utils": ^7.10.4
"@babel/traverse": ^7.11.5
"@babel/helper-compilation-targets": ^7.13.0
"@babel/helper-module-imports": ^7.12.13
"@babel/helper-plugin-utils": ^7.13.0
"@babel/traverse": ^7.13.0
debug: ^4.1.1
lodash.debounce: ^4.0.8
resolve: ^1.14.2
semver: ^6.1.2
peerDependencies:
"@babel/core": ^7.4.0-0
checksum: c2298d3b9b0e73d3646baae77f9c794ea5b4d76959a65cecde8622156ffaceca693e84dc0a66faaddbb6f4c96a2785ec07b623bc6b9580d8ebb3335f12efeab5
checksum: 268ad963d95dd22c2fab0822a42b9a5bf7d0d2909bbaacf7377326c70c0071e0423c0092085a7e6531bbaf4ae917f8fa86f15de4da395add99cca900b95a7498
languageName: node
linkType: hard

Expand Down Expand Up @@ -3398,7 +3398,7 @@ __metadata:
languageName: unknown
linkType: soft

"@babel/traverse@npm:^7.0.0, @babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.11.5, @babel/traverse@npm:^7.13.0":
"@babel/traverse@npm:^7.0.0, @babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0":
version: 7.13.0
resolution: "@babel/traverse@npm:7.13.0"
dependencies:
Expand Down

0 comments on commit bfd30b9

Please sign in to comment.