@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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +34 -20
- package/dist/build.js.map +3 -3
- package/dist/index.js +34 -20
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -171649,25 +171649,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171649
171649
|
htmxDir
|
|
171650
171650
|
].filter((d) => Boolean(d));
|
|
171651
171651
|
const workerEntryPoints = await scanWorkerReferences(frameworkDirs);
|
|
171652
|
-
if (hmr) {
|
|
171653
|
-
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
171654
|
-
for (const outputPath of reactClientOutputPaths) {
|
|
171655
|
-
let content = readFileSync5(outputPath, "utf-8");
|
|
171656
|
-
let changed = false;
|
|
171657
|
-
content = content.replace(urlPattern, (_match, relPath) => {
|
|
171658
|
-
const targetName = basename5(relPath);
|
|
171659
|
-
const workerSrc = workerEntryPoints.find((wp) => basename5(wp) === targetName);
|
|
171660
|
-
if (workerSrc) {
|
|
171661
|
-
const rel = relative7(projectRoot, workerSrc);
|
|
171662
|
-
changed = true;
|
|
171663
|
-
return `new URL('/@src/${rel.replace(/\\/g, "/")}', import.meta.url)`;
|
|
171664
|
-
}
|
|
171665
|
-
return _match;
|
|
171666
|
-
});
|
|
171667
|
-
if (changed)
|
|
171668
|
-
writeFileSync3(outputPath, content);
|
|
171669
|
-
}
|
|
171670
|
-
}
|
|
171671
171652
|
const nonReactClientLogs = nonReactClientResult?.logs ?? [];
|
|
171672
171653
|
const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
|
|
171673
171654
|
if (nonReactClientResult && !nonReactClientResult.success && nonReactClientLogs.length > 0) {
|
|
@@ -171698,6 +171679,39 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171698
171679
|
if (vueCssResult && !vueCssResult.success && vueCssResult.logs.length > 0) {
|
|
171699
171680
|
extractBuildError(vueCssResult.logs, "vue-css", "Vue CSS", frameworkNames, isIncremental, throwOnError);
|
|
171700
171681
|
}
|
|
171682
|
+
if (hmr && workerEntryPoints.length > 0) {
|
|
171683
|
+
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
171684
|
+
const allClientOutputPaths = [
|
|
171685
|
+
...reactClientOutputPaths,
|
|
171686
|
+
...nonReactClientOutputs.map((a) => a.path)
|
|
171687
|
+
];
|
|
171688
|
+
const detectFramework = (outputPath) => {
|
|
171689
|
+
const relOut = relative7(buildPath, outputPath).replace(/\\/g, "/");
|
|
171690
|
+
for (const dir of frameworkDirs) {
|
|
171691
|
+
const dirName = basename5(dir);
|
|
171692
|
+
if (relOut.startsWith(dirName + "/"))
|
|
171693
|
+
return dir;
|
|
171694
|
+
}
|
|
171695
|
+
return frameworkDirs[0];
|
|
171696
|
+
};
|
|
171697
|
+
for (const outputPath of allClientOutputPaths) {
|
|
171698
|
+
let content = readFileSync5(outputPath, "utf-8");
|
|
171699
|
+
let changed = false;
|
|
171700
|
+
const frameworkDir = detectFramework(outputPath);
|
|
171701
|
+
content = content.replace(urlPattern, (_match, relPath) => {
|
|
171702
|
+
const targetName = basename5(relPath);
|
|
171703
|
+
const workerSrc = workerEntryPoints.find((wp) => basename5(wp) === targetName && frameworkDir && wp.startsWith(frameworkDir)) ?? workerEntryPoints.find((wp) => basename5(wp) === targetName);
|
|
171704
|
+
if (workerSrc) {
|
|
171705
|
+
const rel = relative7(projectRoot, workerSrc);
|
|
171706
|
+
changed = true;
|
|
171707
|
+
return `new URL('/@src/${rel.replace(/\\/g, "/")}', import.meta.url)`;
|
|
171708
|
+
}
|
|
171709
|
+
return _match;
|
|
171710
|
+
});
|
|
171711
|
+
if (changed)
|
|
171712
|
+
writeFileSync3(outputPath, content);
|
|
171713
|
+
}
|
|
171714
|
+
}
|
|
171701
171715
|
let workerOutputs = [];
|
|
171702
171716
|
if (workerEntryPoints.length > 0) {
|
|
171703
171717
|
const workerResult = await bunBuild6({
|
|
@@ -205069,5 +205083,5 @@ export {
|
|
|
205069
205083
|
build
|
|
205070
205084
|
};
|
|
205071
205085
|
|
|
205072
|
-
//# debugId=
|
|
205086
|
+
//# debugId=F563E4A89E8B268864756E2164756E21
|
|
205073
205087
|
//# sourceMappingURL=build.js.map
|