@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/build.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) => {
@@ -205145,5 +205171,5 @@ export {
205145
205171
  build
205146
205172
  };
205147
205173
 
205148
- //# debugId=0F563F1AF03F4FFC64756E2164756E21
205174
+ //# debugId=A9E3E3DE3F8F132864756E2164756E21
205149
205175
  //# sourceMappingURL=build.js.map