Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preset-env throws exception for export * as x #16181

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/babel-preset-env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,10 @@ option \`forceAllTransforms: true\` instead.
// other plugin. We can consider adding bundlers as targets in the future,
// but we should not have a one-off special case for this plugin.
if (
optionsModules === "auto" &&
!api.caller(supportsExportNamespaceFrom) &&
!exclude.plugins.has("transform-export-namespace-from")
!exclude.plugins.has("transform-export-namespace-from") &&
(optionsModules === "auto"
? !api.caller(supportsExportNamespaceFrom)
: !!modules)
) {
include.plugins.add("transform-export-namespace-from");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as Extra from "./extra.js"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"env",
{
"modules": "commonjs",
"targets": "node 16"
}
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Extra = void 0;
var _Extra = babelHelpers.interopRequireWildcard(require("./extra.js"));
exports.Extra = _Extra;