@absolutejs/absolute 0.19.0-beta.151 → 0.19.0-beta.152

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.js CHANGED
@@ -202780,10 +202780,36 @@ ${stubs}
202780
202780
  let result = runtime + `
202781
202781
  ` + code;
202782
202782
  for (const name of useExports) {
202783
- const exportPattern = new RegExp(`(export\\s+var\\s+${name}\\s*=\\s*)`, "g");
202784
- result = result.replace(exportPattern, `$1__hmr_wrap(${JSON.stringify(name)}, `);
202785
- const closingPattern = new RegExp(`(export\\s+var\\s+${name}\\s*=\\s*__hmr_wrap\\([^)]+,\\s*)([\\s\\S]*?)(;\\s*(?:export\\s|$))`, "");
202786
- result = result.replace(closingPattern, `$1$2)$3`);
202783
+ const marker = new RegExp(`export\\s+(?:const|var|let)\\s+${name}\\s*=\\s*`);
202784
+ const match = marker.exec(result);
202785
+ if (!match)
202786
+ continue;
202787
+ const insertPos = match.index + match[0].length;
202788
+ let depth = 0;
202789
+ let inString = false;
202790
+ let endPos = insertPos;
202791
+ for (let i = insertPos;i < result.length; i++) {
202792
+ const ch = result[i];
202793
+ if (inString) {
202794
+ if (ch === inString && result[i - 1] !== "\\")
202795
+ inString = false;
202796
+ continue;
202797
+ }
202798
+ if (ch === '"' || ch === "'" || ch === "`") {
202799
+ inString = ch;
202800
+ continue;
202801
+ }
202802
+ if (ch === "{" || ch === "(")
202803
+ depth++;
202804
+ if (ch === "}" || ch === ")")
202805
+ depth--;
202806
+ if (depth === 0 && ch === ";") {
202807
+ endPos = i;
202808
+ break;
202809
+ }
202810
+ }
202811
+ const funcBody = result.slice(insertPos, endPos);
202812
+ result = result.slice(0, insertPos) + `__hmr_wrap(${JSON.stringify(name)}, ${funcBody})` + result.slice(endPos);
202787
202813
  }
202788
202814
  return result;
202789
202815
  }, svelteExternalCss, svelteCompiler = null, vueCompiler = null, warmCompilers = async (frameworks) => {
@@ -205807,5 +205833,5 @@ export {
205807
205833
  ANGULAR_INIT_TIMEOUT_MS
205808
205834
  };
205809
205835
 
205810
- //# debugId=BA74A87B2B45F5CB64756E2164756E21
205836
+ //# debugId=4644DA352AFC957E64756E2164756E21
205811
205837
  //# sourceMappingURL=index.js.map