@absolutejs/absolute 0.19.0-beta.6 → 0.19.0-beta.8

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
@@ -171235,6 +171235,29 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171235
171235
  setAngularVendorPaths(angularVendorPaths2);
171236
171236
  }
171237
171237
  const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
171238
+ const freshFilePlugin = isIncremental ? {
171239
+ name: "hmr-fresh-files",
171240
+ setup(pluginBuild) {
171241
+ pluginBuild.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
171242
+ try {
171243
+ const contents = readFileSync5(args.path, "utf-8");
171244
+ const ext = args.path.split(".").pop() ?? "tsx";
171245
+ const loaderMap = {
171246
+ js: "js",
171247
+ jsx: "jsx",
171248
+ ts: "ts",
171249
+ tsx: "tsx"
171250
+ };
171251
+ return {
171252
+ contents,
171253
+ loader: loaderMap[ext] ?? "tsx"
171254
+ };
171255
+ } catch {
171256
+ return;
171257
+ }
171258
+ });
171259
+ }
171260
+ } : undefined;
171238
171261
  const reactBuildConfig = reactClientEntryPoints.length > 0 ? {
171239
171262
  entrypoints: reactClientEntryPoints,
171240
171263
  ...vendorPaths ? { external: Object.keys(vendorPaths) } : {},
@@ -171243,6 +171266,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171243
171266
  naming: `[dir]/[name].[hash].[ext]`,
171244
171267
  outdir: buildPath,
171245
171268
  ...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
171269
+ ...freshFilePlugin ? { plugins: [freshFilePlugin] } : {},
171246
171270
  root: clientRoot,
171247
171271
  splitting: true,
171248
171272
  target: "browser",
@@ -202550,17 +202574,38 @@ var parseErrorLocationFromMessage = (msg) => {
202550
202574
  vendorPaths = computeVendorPaths2();
202551
202575
  setDevVendorPaths2(vendorPaths);
202552
202576
  }
202553
- const { rmSync: rmSync2 } = await import("fs");
202577
+ const { rmSync: rmSync2, readFileSync: readFileSync9 } = await import("fs");
202554
202578
  rmSync2(resolve18(buildDir, "react", "indexes"), {
202555
202579
  force: true,
202556
202580
  recursive: true
202557
202581
  });
202582
+ const freshFilePlugin = {
202583
+ name: "hmr-fresh-files",
202584
+ setup(build2) {
202585
+ build2.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
202586
+ try {
202587
+ const contents = readFileSync9(args.path, "utf-8");
202588
+ const ext = args.path.split(".").pop() ?? "tsx";
202589
+ const loaderMap = {
202590
+ js: "js",
202591
+ jsx: "jsx",
202592
+ ts: "ts",
202593
+ tsx: "tsx"
202594
+ };
202595
+ return { contents, loader: loaderMap[ext] ?? "tsx" };
202596
+ } catch {
202597
+ return;
202598
+ }
202599
+ });
202600
+ }
202601
+ };
202558
202602
  const clientResult = await bunBuild5({
202559
202603
  entrypoints: reactEntries,
202560
202604
  format: "esm",
202561
202605
  jsx: { development: true },
202562
202606
  naming: "[dir]/[name].[hash].[ext]",
202563
202607
  outdir: buildDir,
202608
+ plugins: [freshFilePlugin],
202564
202609
  reactFastRefresh: true,
202565
202610
  root: clientRoot,
202566
202611
  splitting: true,
@@ -203653,5 +203698,5 @@ export {
203653
203698
  build
203654
203699
  };
203655
203700
 
203656
- //# debugId=1D33E4408EA8223D64756E2164756E21
203701
+ //# debugId=73EEB4B420C6458764756E2164756E21
203657
203702
  //# sourceMappingURL=build.js.map