@absolutejs/absolute 0.19.0-beta.132 → 0.19.0-beta.134

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
@@ -171728,25 +171728,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171728
171728
  htmxDir
171729
171729
  ].filter((d) => Boolean(d));
171730
171730
  const workerEntryPoints = await scanWorkerReferences(frameworkDirs);
171731
- if (hmr) {
171732
- const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
171733
- for (const outputPath of reactClientOutputPaths) {
171734
- let content = readFileSync5(outputPath, "utf-8");
171735
- let changed = false;
171736
- content = content.replace(urlPattern, (_match, relPath) => {
171737
- const targetName = basename5(relPath);
171738
- const workerSrc = workerEntryPoints.find((wp) => basename5(wp) === targetName);
171739
- if (workerSrc) {
171740
- const rel = relative7(projectRoot, workerSrc);
171741
- changed = true;
171742
- return `new URL('/@src/${rel.replace(/\\/g, "/")}', import.meta.url)`;
171743
- }
171744
- return _match;
171745
- });
171746
- if (changed)
171747
- writeFileSync3(outputPath, content);
171748
- }
171749
- }
171750
171731
  const nonReactClientLogs = nonReactClientResult?.logs ?? [];
171751
171732
  const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
171752
171733
  if (nonReactClientResult && !nonReactClientResult.success && nonReactClientLogs.length > 0) {
@@ -171777,6 +171758,39 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171777
171758
  if (vueCssResult && !vueCssResult.success && vueCssResult.logs.length > 0) {
171778
171759
  extractBuildError(vueCssResult.logs, "vue-css", "Vue CSS", frameworkNames, isIncremental, throwOnError);
171779
171760
  }
171761
+ if (hmr && workerEntryPoints.length > 0) {
171762
+ const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
171763
+ const allClientOutputPaths = [
171764
+ ...reactClientOutputPaths,
171765
+ ...nonReactClientOutputs.map((a) => a.path)
171766
+ ];
171767
+ const detectFramework = (outputPath) => {
171768
+ const relOut = relative7(buildPath, outputPath).replace(/\\/g, "/");
171769
+ for (const dir of frameworkDirs) {
171770
+ const dirName = basename5(dir);
171771
+ if (relOut.startsWith(dirName + "/"))
171772
+ return dir;
171773
+ }
171774
+ return frameworkDirs[0];
171775
+ };
171776
+ for (const outputPath of allClientOutputPaths) {
171777
+ let content = readFileSync5(outputPath, "utf-8");
171778
+ let changed = false;
171779
+ const frameworkDir = detectFramework(outputPath);
171780
+ content = content.replace(urlPattern, (_match, relPath) => {
171781
+ const targetName = basename5(relPath);
171782
+ const workerSrc = workerEntryPoints.find((wp) => basename5(wp) === targetName && frameworkDir && wp.startsWith(frameworkDir)) ?? workerEntryPoints.find((wp) => basename5(wp) === targetName);
171783
+ if (workerSrc) {
171784
+ const rel = relative7(projectRoot, workerSrc);
171785
+ changed = true;
171786
+ return `new URL('/@src/${rel.replace(/\\/g, "/")}', import.meta.url)`;
171787
+ }
171788
+ return _match;
171789
+ });
171790
+ if (changed)
171791
+ writeFileSync3(outputPath, content);
171792
+ }
171793
+ }
171780
171794
  let workerOutputs = [];
171781
171795
  if (workerEntryPoints.length > 0) {
171782
171796
  const workerResult = await bunBuild6({
@@ -205731,5 +205745,5 @@ export {
205731
205745
  ANGULAR_INIT_TIMEOUT_MS
205732
205746
  };
205733
205747
 
205734
- //# debugId=9ACCBA59801C8BAE64756E2164756E21
205748
+ //# debugId=0752DF2B88DFF98D64756E2164756E21
205735
205749
  //# sourceMappingURL=index.js.map