rollup-plugin-concurrent-top-level-await 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -173,7 +173,13 @@ function tansformAndMoveDeclarationsToModuleScope(s, ast, asyncImports) {
|
|
|
173
173
|
if (n.type === "VariableDeclaration" && n.kind === "var") s = moveVariableDeclarationToModuleScope(s, n, moduleScopeEnd);
|
|
174
174
|
return false;
|
|
175
175
|
});
|
|
176
|
-
if (
|
|
176
|
+
if (node.type === "ExportDefaultDeclaration" && !isDeclaration(node.declaration.type)) {
|
|
177
|
+
s = s.appendLeft(moduleScopeEnd, "let __tla_default;\nexport { __tla_default as default };\n");
|
|
178
|
+
s = s.remove(node.start, node.declaration.start);
|
|
179
|
+
s = s.appendRight(node.declaration.start, ";__tla_default = (");
|
|
180
|
+
s = s.appendLeft(node.declaration.end, ");");
|
|
181
|
+
}
|
|
182
|
+
if (isDeclaration(node.type) || node.type === "ImportDeclaration" || node.type === "ExportDefaultDeclaration" && isDeclaration(node.declaration.type) || node.type === "ExportNamedDeclaration" && isDeclaration(node.declaration?.type) || node.type === "ExportNamedDeclaration" && node.declaration == null || node.type === "ExportAllDeclaration") if (node.start > moduleScopeEnd) {
|
|
177
183
|
s = s.appendRight(node.start, ";\n");
|
|
178
184
|
s = s.move(node.start, node.end, moduleScopeEnd);
|
|
179
185
|
} else moduleScopeEnd = node.end;
|
package/package.json
CHANGED