@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/build.js CHANGED
@@ -46,6 +46,36 @@ var __export = (target, all) => {
46
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
47
  var __require = import.meta.require;
48
48
 
49
+ // src/build/freshReadPlugin.ts
50
+ var createFreshReadPlugin = (changedFiles) => {
51
+ const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
52
+ const escaped = changedFiles.map((f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
53
+ const pattern = escaped.length > 0 ? new RegExp(`(${escaped.join("|")})$`) : /(?!)/;
54
+ return {
55
+ name: "fresh-read",
56
+ setup(build) {
57
+ build.onLoad({ filter: pattern }, async (args) => {
58
+ const normalized = args.path.replace(/\\/g, "/");
59
+ if (!changed.has(normalized))
60
+ return;
61
+ const contents = await Bun.file(args.path).text();
62
+ const ext = args.path.split(".").pop();
63
+ const loaderMap = {
64
+ ts: "ts",
65
+ tsx: "tsx",
66
+ js: "js",
67
+ jsx: "jsx",
68
+ css: "css"
69
+ };
70
+ return {
71
+ contents,
72
+ loader: loaderMap[ext ?? ""] ?? "ts"
73
+ };
74
+ });
75
+ }
76
+ };
77
+ };
78
+
49
79
  // src/constants.ts
50
80
  var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DOM_UPDATE_DELAY_MS = 50, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000;
51
81
  var init_constants = __esm(() => {
@@ -171211,6 +171241,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171211
171241
  await resolveAbsoluteVersion();
171212
171242
  const isIncremental = incrementalFiles && incrementalFiles.length > 0;
171213
171243
  const normalizedIncrementalFiles = incrementalFiles?.map(normalizePath);
171244
+ const freshReadPlugins = isIncremental ? [createFreshReadPlugin(incrementalFiles)] : [];
171214
171245
  const throwOnError = options?.throwOnError === true;
171215
171246
  const hmr = options?.injectHMR === true;
171216
171247
  const buildPath = validateSafePath(buildDirectory, projectRoot);
@@ -171468,6 +171499,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171468
171499
  naming: `[dir]/[name].[hash].[ext]`,
171469
171500
  outdir: buildPath,
171470
171501
  ...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
171502
+ plugins: [...freshReadPlugins],
171471
171503
  root: clientRoot,
171472
171504
  splitting: true,
171473
171505
  target: "browser",
@@ -171513,6 +171545,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171513
171545
  format: "esm",
171514
171546
  naming: `[dir]/[name].[hash].[ext]`,
171515
171547
  outdir: serverOutDir,
171548
+ plugins: [...freshReadPlugins],
171516
171549
  root: serverRoot,
171517
171550
  target: "bun",
171518
171551
  throw: false
@@ -171531,6 +171564,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171531
171564
  naming: `[dir]/[name].[hash].[ext]`,
171532
171565
  outdir: buildPath,
171533
171566
  plugins: [
171567
+ ...freshReadPlugins,
171534
171568
  ...angularDir && !isDev ? [angularLinkerPlugin] : [],
171535
171569
  ...htmlScriptPlugin ? [htmlScriptPlugin] : []
171536
171570
  ],
@@ -204865,5 +204899,5 @@ export {
204865
204899
  build
204866
204900
  };
204867
204901
 
204868
- //# debugId=61FBA4F3A9C4EF4164756E2164756E21
204902
+ //# debugId=089B7D6D18958E0A64756E2164756E21
204869
204903
  //# sourceMappingURL=build.js.map