@absolutejs/absolute 0.19.0-beta.73 → 0.19.0-beta.74

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
@@ -133,6 +133,36 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
133
133
  </html>`;
134
134
  };
135
135
 
136
+ // src/build/freshReadPlugin.ts
137
+ var createFreshReadPlugin = (changedFiles) => {
138
+ const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
139
+ const escaped = changedFiles.map((f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
140
+ const pattern = escaped.length > 0 ? new RegExp(`(${escaped.join("|")})$`) : /(?!)/;
141
+ return {
142
+ name: "fresh-read",
143
+ setup(build2) {
144
+ build2.onLoad({ filter: pattern }, async (args) => {
145
+ const normalized = args.path.replace(/\\/g, "/");
146
+ if (!changed.has(normalized))
147
+ return;
148
+ const contents = await Bun.file(args.path).text();
149
+ const ext = args.path.split(".").pop();
150
+ const loaderMap = {
151
+ ts: "ts",
152
+ tsx: "tsx",
153
+ js: "js",
154
+ jsx: "jsx",
155
+ css: "css"
156
+ };
157
+ return {
158
+ contents,
159
+ loader: loaderMap[ext ?? ""] ?? "ts"
160
+ };
161
+ });
162
+ }
163
+ };
164
+ };
165
+
136
166
  // src/utils/normalizePath.ts
137
167
  var normalizePath = (path) => path.replace(/\\/g, "/");
138
168
 
@@ -171290,6 +171320,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171290
171320
  await resolveAbsoluteVersion();
171291
171321
  const isIncremental = incrementalFiles && incrementalFiles.length > 0;
171292
171322
  const normalizedIncrementalFiles = incrementalFiles?.map(normalizePath);
171323
+ const freshReadPlugins = isIncremental ? [createFreshReadPlugin(incrementalFiles)] : [];
171293
171324
  const throwOnError = options?.throwOnError === true;
171294
171325
  const hmr = options?.injectHMR === true;
171295
171326
  const buildPath = validateSafePath(buildDirectory, projectRoot);
@@ -171547,6 +171578,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171547
171578
  naming: `[dir]/[name].[hash].[ext]`,
171548
171579
  outdir: buildPath,
171549
171580
  ...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
171581
+ plugins: [...freshReadPlugins],
171550
171582
  root: clientRoot,
171551
171583
  splitting: true,
171552
171584
  target: "browser",
@@ -171592,6 +171624,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171592
171624
  format: "esm",
171593
171625
  naming: `[dir]/[name].[hash].[ext]`,
171594
171626
  outdir: serverOutDir,
171627
+ plugins: [...freshReadPlugins],
171595
171628
  root: serverRoot,
171596
171629
  target: "bun",
171597
171630
  throw: false
@@ -171610,6 +171643,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171610
171643
  naming: `[dir]/[name].[hash].[ext]`,
171611
171644
  outdir: buildPath,
171612
171645
  plugins: [
171646
+ ...freshReadPlugins,
171613
171647
  ...angularDir && !isDev ? [angularLinkerPlugin] : [],
171614
171648
  ...htmlScriptPlugin ? [htmlScriptPlugin] : []
171615
171649
  ],
@@ -205270,5 +205304,5 @@ export {
205270
205304
  ANGULAR_INIT_TIMEOUT_MS
205271
205305
  };
205272
205306
 
205273
- //# debugId=FFF411E23F884D9A64756E2164756E21
205307
+ //# debugId=425D48C1FC21F89264756E2164756E21
205274
205308
  //# sourceMappingURL=index.js.map