committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
13
node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
generated
vendored
13
node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
generated
vendored
@ -30,9 +30,9 @@ function validateImportInteropOption(importInterop) {
|
||||
return importInterop;
|
||||
}
|
||||
|
||||
function resolveImportInterop(importInterop, source) {
|
||||
function resolveImportInterop(importInterop, source, filename) {
|
||||
if (typeof importInterop === "function") {
|
||||
return validateImportInteropOption(importInterop(source));
|
||||
return validateImportInteropOption(importInterop(source, filename));
|
||||
}
|
||||
|
||||
return importInterop;
|
||||
@ -42,7 +42,8 @@ function normalizeModuleAndLoadMetadata(programPath, exportName, {
|
||||
importInterop,
|
||||
initializeReexports = false,
|
||||
lazy = false,
|
||||
esNamespaceOnly = false
|
||||
esNamespaceOnly = false,
|
||||
filename
|
||||
}) {
|
||||
if (!exportName) {
|
||||
exportName = programPath.scope.generateUidIdentifier("exports").name;
|
||||
@ -65,7 +66,7 @@ function normalizeModuleAndLoadMetadata(programPath, exportName, {
|
||||
metadata.name = metadata.importsNamespace.values().next().value;
|
||||
}
|
||||
|
||||
const resolvedInterop = resolveImportInterop(importInterop, metadata.source);
|
||||
const resolvedInterop = resolveImportInterop(importInterop, metadata.source, filename);
|
||||
|
||||
if (resolvedInterop === "none") {
|
||||
metadata.interop = "none";
|
||||
@ -269,7 +270,9 @@ function getLocalExportMetadata(programPath, initializeReexports, stringSpecifie
|
||||
if (child.isImportDeclaration()) {
|
||||
kind = "import";
|
||||
} else {
|
||||
if (child.isExportDefaultDeclaration()) child = child.get("declaration");
|
||||
if (child.isExportDefaultDeclaration()) {
|
||||
child = child.get("declaration");
|
||||
}
|
||||
|
||||
if (child.isExportNamedDeclaration()) {
|
||||
if (child.node.declaration) {
|
||||
|
Reference in New Issue
Block a user