@absolutejs/absolute 0.18.9-beta.1 → 0.18.9-beta.3
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 +29 -5
- package/dist/build.js.map +5 -5
- package/dist/index.js +31 -8
- package/dist/index.js.map +6 -6
- package/dist/react/index.js +3 -4
- package/dist/react/index.js.map +3 -3
- package/dist/src/build/rewriteReactImports.d.ts +1 -0
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -705,6 +705,16 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), applyAllR
|
|
|
705
705
|
result = result.replace(dynamicRegex, `$1${webPath}$2`);
|
|
706
706
|
}
|
|
707
707
|
return result;
|
|
708
|
+
}, REFRESH_STUBS, patchRefreshGlobals = async (outputPaths) => {
|
|
709
|
+
const jsFiles = outputPaths.filter((path) => path.endsWith(".js"));
|
|
710
|
+
await Promise.all(jsFiles.map(async (filePath) => {
|
|
711
|
+
const content = await Bun.file(filePath).text();
|
|
712
|
+
if (!content.includes("$RefreshReg$(") && !content.includes("$RefreshSig$("))
|
|
713
|
+
return;
|
|
714
|
+
if (content.startsWith("window.$RefreshReg$"))
|
|
715
|
+
return;
|
|
716
|
+
await Bun.write(filePath, REFRESH_STUBS + content);
|
|
717
|
+
}));
|
|
708
718
|
}, rewriteReactImports = async (outputPaths, vendorPaths) => {
|
|
709
719
|
const jsFiles = outputPaths.filter((path) => path.endsWith(".js"));
|
|
710
720
|
if (jsFiles.length === 0)
|
|
@@ -718,6 +728,10 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), applyAllR
|
|
|
718
728
|
}
|
|
719
729
|
}));
|
|
720
730
|
};
|
|
731
|
+
var init_rewriteReactImports = __esm(() => {
|
|
732
|
+
REFRESH_STUBS = "window.$RefreshReg$||(window.$RefreshReg$=function(){});" + `window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});
|
|
733
|
+
`;
|
|
734
|
+
});
|
|
721
735
|
|
|
722
736
|
// src/core/devVendorPaths.ts
|
|
723
737
|
var exports_devVendorPaths = {};
|
|
@@ -171257,8 +171271,12 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171257
171271
|
if (reactClientResult && !reactClientResult.success && reactClientLogs.length > 0) {
|
|
171258
171272
|
extractBuildError(reactClientLogs, "react-client", "React client", frameworkNames, isIncremental, throwOnError);
|
|
171259
171273
|
}
|
|
171260
|
-
|
|
171261
|
-
|
|
171274
|
+
const reactClientOutputPaths = reactClientOutputs.map((artifact) => artifact.path);
|
|
171275
|
+
if (vendorPaths && reactClientOutputPaths.length > 0) {
|
|
171276
|
+
await rewriteReactImports(reactClientOutputPaths, vendorPaths);
|
|
171277
|
+
}
|
|
171278
|
+
if (hmr && reactClientOutputPaths.length > 0) {
|
|
171279
|
+
await patchRefreshGlobals(reactClientOutputPaths);
|
|
171262
171280
|
}
|
|
171263
171281
|
const nonReactClientLogs = nonReactClientResult?.logs ?? [];
|
|
171264
171282
|
const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
|
|
@@ -171410,6 +171428,7 @@ var init_build = __esm(() => {
|
|
|
171410
171428
|
init_scanCssEntryPoints();
|
|
171411
171429
|
init_updateAssetPaths();
|
|
171412
171430
|
init_buildHMRClient();
|
|
171431
|
+
init_rewriteReactImports();
|
|
171413
171432
|
init_telemetryEvent();
|
|
171414
171433
|
init_angularLinkerPlugin();
|
|
171415
171434
|
init_cleanStaleOutputs();
|
|
@@ -202478,9 +202497,11 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
202478
202497
|
if (!clientResult.success) {
|
|
202479
202498
|
return;
|
|
202480
202499
|
}
|
|
202500
|
+
const clientOutputPaths = clientResult.outputs.map((art) => art.path);
|
|
202481
202501
|
if (vendorPaths) {
|
|
202482
|
-
await rewriteReactImports(
|
|
202502
|
+
await rewriteReactImports(clientOutputPaths, vendorPaths);
|
|
202483
202503
|
}
|
|
202504
|
+
await patchRefreshGlobals(clientOutputPaths);
|
|
202484
202505
|
const clientManifest = generateManifest(clientResult.outputs, buildDir);
|
|
202485
202506
|
Object.assign(state.manifest, clientManifest);
|
|
202486
202507
|
populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
@@ -202509,9 +202530,11 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
202509
202530
|
if (!result.success) {
|
|
202510
202531
|
return;
|
|
202511
202532
|
}
|
|
202533
|
+
const pageOutputPaths = result.outputs.map((artifact) => artifact.path);
|
|
202512
202534
|
if (vendorPaths) {
|
|
202513
|
-
await rewriteReactImports(
|
|
202535
|
+
await rewriteReactImports(pageOutputPaths, vendorPaths);
|
|
202514
202536
|
}
|
|
202537
|
+
await patchRefreshGlobals(pageOutputPaths);
|
|
202515
202538
|
const pageManifest = generateManifest(result.outputs, buildDir);
|
|
202516
202539
|
Object.assign(state.manifest, pageManifest);
|
|
202517
202540
|
populateAssetStore(state.assetStore, pageManifest, buildDir);
|
|
@@ -203424,6 +203447,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
203424
203447
|
init_compileVue();
|
|
203425
203448
|
init_compileAngular();
|
|
203426
203449
|
init_commonAncestor();
|
|
203450
|
+
init_rewriteReactImports();
|
|
203427
203451
|
});
|
|
203428
203452
|
|
|
203429
203453
|
// src/core/devBuild.ts
|
|
@@ -203654,5 +203678,5 @@ export {
|
|
|
203654
203678
|
build
|
|
203655
203679
|
};
|
|
203656
203680
|
|
|
203657
|
-
//# debugId=
|
|
203681
|
+
//# debugId=8FC2AE7598A9681164756E2164756E21
|
|
203658
203682
|
//# sourceMappingURL=build.js.map
|