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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -1
  2. 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 (isDeclaration(node.type) || node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && isDeclaration(node.declaration?.type) || node.type === "ExportNamedDeclaration" && node.declaration == null || node.type === "ExportDefaultDeclaration" || node.type === "ExportAllDeclaration") if (node.start > moduleScopeEnd) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup-plugin-concurrent-top-level-await",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Rollup (and Vite) plugin enabling concurrent execution of modules that contain top level await.",
5
5
  "keywords": [
6
6
  "rollup-plugin",