Merge pull request #2539 from theit8514/export-from-import

Expand support for Export declarations with source parameters
This commit is contained in:
hydroflame 2022-01-11 11:17:39 -05:00 committed by GitHub
commit 0bbe060074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,6 +151,24 @@ function _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): Scri
start: node.source.range[0] + 1, start: node.source.range[0] + 1,
end: node.source.range[1] - 1 end: node.source.range[1] - 1
}); });
},
ExportNamedDeclaration(node: any) {
if (node.source) {
importNodes.push({
filename: node.source.value,
start: node.source.range[0] + 1,
end: node.source.range[1] - 1
});
}
},
ExportAllDeclaration(node: any) {
if (node.source) {
importNodes.push({
filename: node.source.value,
start: node.source.range[0] + 1,
end: node.source.range[1] - 1
});
}
} }
}); });
// Sort the nodes from last start index to first. This replaces the last import with a blob first, // Sort the nodes from last start index to first. This replaces the last import with a blob first,