@absolutejs/absolute 0.19.0-beta.760 → 0.19.0-beta.762

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
@@ -43509,7 +43509,10 @@ __export(exports_compileAngular, {
43509
43509
  import { existsSync as existsSync16, readFileSync as readFileSync9, promises as fs2 } from "fs";
43510
43510
  import { join as join15, basename as basename6, sep as sep3, dirname as dirname10, resolve as resolve16, relative as relative9 } from "path";
43511
43511
  import ts2 from "typescript";
43512
- var readTsconfigPathAliases = () => {
43512
+ var traceAngularPhase = async (name, fn, metadata) => {
43513
+ const tracePhase = globalThis.__absoluteBuildTracePhase;
43514
+ return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
43515
+ }, readTsconfigPathAliases = () => {
43513
43516
  try {
43514
43517
  const configPath2 = resolve16(process.cwd(), "tsconfig.json");
43515
43518
  const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
@@ -43759,18 +43762,20 @@ ${registrations}
43759
43762
  await Promise.all(inputPaths.map((inputPath) => transformFile(inputPath)));
43760
43763
  return transformedSources;
43761
43764
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
43762
- const islandMetadataByOutputPath = new Map(inputPaths.map((inputPath) => {
43765
+ const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
43763
43766
  const outputPath = resolve16(join15(outDir, relative9(process.cwd(), resolve16(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
43764
43767
  return [
43765
43768
  outputPath,
43766
43769
  buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"))
43767
43770
  ];
43768
- }));
43769
- const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
43770
- const tsPath = __require.resolve("typescript");
43771
- const tsRootDir = dirname10(tsPath);
43772
- const tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve16(tsRootDir, "lib");
43773
- const config = readConfiguration("./tsconfig.json");
43771
+ })), { entries: inputPaths.length });
43772
+ const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
43773
+ const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
43774
+ const tsPath = __require.resolve("typescript");
43775
+ const tsRootDir = dirname10(tsPath);
43776
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve16(tsRootDir, "lib");
43777
+ });
43778
+ const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
43774
43779
  const options = {
43775
43780
  emitDecoratorMetadata: true,
43776
43781
  esModuleInterop: true,
@@ -43793,7 +43798,7 @@ ${registrations}
43793
43798
  options.incremental = false;
43794
43799
  options.tsBuildInfoFile = undefined;
43795
43800
  options.rootDir = process.cwd();
43796
- const host = ts2.createCompilerHost(options);
43801
+ const host = await traceAngularPhase("aot/create-compiler-host", () => ts2.createCompilerHost(options));
43797
43802
  const originalGetDefaultLibLocation = host.getDefaultLibLocation;
43798
43803
  host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
43799
43804
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
@@ -43816,7 +43821,7 @@ ${registrations}
43816
43821
  emitted[relativePath] = text;
43817
43822
  };
43818
43823
  const originalReadFile = host.readFile;
43819
- const aotTransformedSources = await precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors);
43824
+ const aotTransformedSources = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors), { entries: inputPaths.length });
43820
43825
  host.readFile = (fileName) => {
43821
43826
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
43822
43827
  if (typeof source !== "string")
@@ -43837,42 +43842,46 @@ ${registrations}
43837
43842
  };
43838
43843
  let diagnostics;
43839
43844
  try {
43840
- ({ diagnostics } = performCompilation({
43845
+ ({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
43841
43846
  emitFlags: EmitFlags.Default,
43842
43847
  host,
43843
43848
  options,
43844
43849
  rootNames: inputPaths
43845
- }));
43850
+ }), { entries: inputPaths.length }));
43846
43851
  } finally {
43847
43852
  host.readFile = originalReadFile;
43848
43853
  host.getSourceFile = originalGetSourceFileForCompile;
43849
43854
  }
43850
- throwOnCompilationErrors(diagnostics);
43851
- const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
43852
- content,
43853
- target: join15(outDir, fileName)
43854
- }));
43855
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve16(target)));
43856
- const entries = rawEntries.map(({ content, target }) => {
43857
- let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
43858
- const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
43859
- if (rewritten !== path2) {
43860
- return `from ${quote}${rewritten}${quote}`;
43861
- }
43862
- return match;
43863
- });
43864
- processedContent = processedContent.replace(/\u0275\u0275domElementStart/g, "\u0275\u0275elementStart").replace(/\u0275\u0275domElementEnd/g, "\u0275\u0275elementEnd").replace(/\u0275\u0275domElement\(/g, "\u0275\u0275element(").replace(/\u0275\u0275domProperty/g, "\u0275\u0275property").replace(/\u0275\u0275domListener/g, "\u0275\u0275listener");
43865
- processedContent = processedContent.replace(/import\s*{\s*([^}]*)\bInjectFlags\b([^}]*)\s*}\s*from\s*['"]@angular\/core['"]/g, (match, before, after) => {
43866
- const cleaned = (before + after).replace(/,\s*,/g, ",").replace(/^\s*,\s*/, "").replace(/,\s*$/, "");
43867
- return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
43855
+ await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
43856
+ const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
43857
+ const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
43858
+ content,
43859
+ target: join15(outDir, fileName)
43860
+ }));
43861
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve16(target)));
43862
+ return rawEntries.map(({ content, target }) => {
43863
+ let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
43864
+ const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
43865
+ if (rewritten !== path2) {
43866
+ return `from ${quote}${rewritten}${quote}`;
43867
+ }
43868
+ return match;
43869
+ });
43870
+ processedContent = processedContent.replace(/\u0275\u0275domElementStart/g, "\u0275\u0275elementStart").replace(/\u0275\u0275domElementEnd/g, "\u0275\u0275elementEnd").replace(/\u0275\u0275domElement\(/g, "\u0275\u0275element(").replace(/\u0275\u0275domProperty/g, "\u0275\u0275property").replace(/\u0275\u0275domListener/g, "\u0275\u0275listener");
43871
+ processedContent = processedContent.replace(/import\s*{\s*([^}]*)\bInjectFlags\b([^}]*)\s*}\s*from\s*['"]@angular\/core['"]/g, (match, before, after) => {
43872
+ const cleaned = (before + after).replace(/,\s*,/g, ",").replace(/^\s*,\s*/, "").replace(/,\s*$/, "");
43873
+ return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
43874
+ });
43875
+ processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
43876
+ processedContent += islandMetadataByOutputPath.get(resolve16(target)) ?? "";
43877
+ return { content: processedContent, target };
43868
43878
  });
43869
- processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
43870
- processedContent += islandMetadataByOutputPath.get(resolve16(target)) ?? "";
43871
- return { content: processedContent, target };
43872
43879
  });
43873
- await Promise.all(entries.map(({ target }) => fs2.mkdir(dirname10(target), { recursive: true })));
43874
- await Promise.all(entries.map(({ target, content }) => fs2.writeFile(target, content, "utf-8")));
43875
- return entries.map(({ target }) => target);
43880
+ await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
43881
+ await fs2.mkdir(dirname10(target), { recursive: true });
43882
+ await fs2.writeFile(target, content, "utf-8");
43883
+ })), { outputs: entries.length });
43884
+ return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
43876
43885
  }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
43877
43886
  const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
43878
43887
  let match;
@@ -43961,31 +43970,31 @@ ${importLine}${source.slice(insertAt)}`;
43961
43970
  }
43962
43971
  return parts.join("");
43963
43972
  }, buildDeferSlotTemplateResolver = () => ` __absoluteDeferTemplateExpressionCache = new Map<string, string>();
43964
- __absoluteDeferResolveTemplateExpression(expression: string) {
43965
- const cached = this.__absoluteDeferTemplateExpressionCache.get(expression);
43966
- if (cached !== undefined) return cached;
43967
-
43968
- const scope = new Proxy(this, {
43969
- get: (_target, property) => {
43970
- const value = (this as Record<PropertyKey, unknown>)[property];
43971
- return typeof value === "function" ? value.bind(this) : value;
43972
- }
43973
- });
43974
- let value = '';
43975
- try {
43976
- const evaluate = new Function(
43977
- 'scope',
43978
- "with (scope) { return (" + expression + "); }"
43979
- );
43980
-
43981
- const resolvedValue = evaluate(scope);
43982
- value = resolvedValue == null ? '' : String(resolvedValue);
43983
- } catch (_error) {
43984
- value = '';
43985
- }
43986
- this.__absoluteDeferTemplateExpressionCache.set(expression, value);
43987
- return value;
43988
- }
43973
+ ` + ` __absoluteDeferResolveTemplateExpression(expression: string) {
43974
+ ` + ` const cached = this.__absoluteDeferTemplateExpressionCache.get(expression);
43975
+ ` + ` if (cached !== undefined) return cached;
43976
+ ` + `
43977
+ ` + ` const scope = new Proxy(this, {
43978
+ ` + ` get: (_target, property) => {
43979
+ ` + ` const value = (this as Record<PropertyKey, unknown>)[property];
43980
+ ` + ` return typeof value === "function" ? value.bind(this) : value;
43981
+ ` + ` }
43982
+ ` + ` });
43983
+ ` + ` let value = '';
43984
+ ` + ` try {
43985
+ ` + ` const evaluate = new Function(
43986
+ ` + ` 'scope',
43987
+ ` + ` "with (scope) { return (" + expression + "); }"
43988
+ ` + ` );
43989
+ ` + `
43990
+ ` + ` const resolvedValue = evaluate(scope);
43991
+ ` + ` value = resolvedValue == null ? '' : String(resolvedValue);
43992
+ ` + ` } catch (_error) {
43993
+ ` + ` value = '';
43994
+ ` + ` }
43995
+ ` + ` this.__absoluteDeferTemplateExpressionCache.set(expression, value);
43996
+ ` + ` return value;
43997
+ ` + ` }
43989
43998
 
43990
43999
  `, buildDeferSlotFields = (slots) => [
43991
44000
  buildDeferSlotTemplateResolver(),
@@ -43999,8 +44008,8 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
43999
44008
  ` : ` __absoluteDeferData${index} = () => ({});
44000
44009
  `;
44001
44010
  return `${htmlField + dataField} __absoluteDeferResolvePayload${index} = () => new Promise<any>((resolve) => {
44002
- setTimeout(() => resolve({ kind: 'angular-defer', state: 'resolved', html: this.__absoluteDeferHtml${index}(), data: this.__absoluteDeferData${index}() }), ${slot.delayMs});
44003
- });
44011
+ ` + ` setTimeout(() => resolve({ kind: 'angular-defer', state: 'resolved', html: this.__absoluteDeferHtml${index}(), data: this.__absoluteDeferData${index}() }), ${slot.delayMs});
44012
+ ` + ` });
44004
44013
  `;
44005
44014
  })
44006
44015
  ].join(`
@@ -44280,14 +44289,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44280
44289
  }
44281
44290
  const compiledRoot = compiledParent;
44282
44291
  const indexesDir = join15(compiledParent, "indexes");
44283
- await fs2.mkdir(indexesDir, { recursive: true });
44284
- const aotOutputs = hmr ? [] : await compileAngularFiles(entryPoints.map((entry) => resolve16(entry)), compiledRoot, stylePreprocessors);
44285
- const usesLegacyAngularAnimations = createLegacyAngularAnimationUsageResolver(outRoot);
44292
+ await traceAngularPhase("setup/create-indexes-dir", () => fs2.mkdir(indexesDir, { recursive: true }));
44293
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve16(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
44294
+ const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
44286
44295
  const compileTasks = entryPoints.map(async (entry) => {
44287
44296
  const resolvedEntry = resolve16(entry);
44288
44297
  const relativeEntry = relative9(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
44289
44298
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
44290
- let outputs = hmr ? await compileEntry() : aotOutputs;
44299
+ let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
44300
+ entry: resolvedEntry
44301
+ }) : aotOutputs;
44291
44302
  const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
44292
44303
  const jsName = `${fileBase}.js`;
44293
44304
  const compiledFallbackPaths = [
@@ -44309,13 +44320,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44309
44320
  }
44310
44321
  return candidate;
44311
44322
  };
44312
- let rawServerFile = resolveRawServerFile(outputs);
44323
+ let rawServerFile = await traceAngularPhase("wrapper/resolve-server-output", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
44313
44324
  if (!rawServerFile) {
44314
- rawServerFile = resolveRawServerFile([]);
44325
+ rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
44315
44326
  }
44316
44327
  if (rawServerFile && !existsSync16(rawServerFile)) {
44317
44328
  outputs = hmr ? await compileEntry() : aotOutputs;
44318
- rawServerFile = resolveRawServerFile(outputs);
44329
+ rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
44319
44330
  }
44320
44331
  if (!rawServerFile || !existsSync16(rawServerFile)) {
44321
44332
  throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
@@ -44323,7 +44334,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44323
44334
  ...compiledFallbackPaths
44324
44335
  ].join(", ")}`);
44325
44336
  }
44326
- const original = await fs2.readFile(rawServerFile, "utf-8");
44337
+ const original = await traceAngularPhase("wrapper/read-server-output", () => fs2.readFile(rawServerFile, "utf-8"), { entry: resolvedEntry });
44327
44338
  const detectExportedComponentClass = (source, fallback) => {
44328
44339
  const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
44329
44340
  if (defaultMatch)
@@ -44333,8 +44344,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44333
44344
  return exportClassMatch[1];
44334
44345
  return fallback;
44335
44346
  };
44336
- const componentClassName = detectExportedComponentClass(original, `${toPascal(fileBase)}Component`);
44337
- const usesLegacyAnimations = await usesLegacyAngularAnimations(resolvedEntry);
44347
+ const componentClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original, `${toPascal(fileBase)}Component`), { entry: resolvedEntry });
44348
+ const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
44338
44349
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
44339
44350
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
44340
44351
  const clientFile = join15(indexesDir, jsName);
@@ -44378,7 +44389,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44378
44389
  `);
44379
44390
  await fs2.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
44380
44391
  }
44381
- await fs2.writeFile(rawServerFile, rewritten, "utf-8");
44392
+ await traceAngularPhase("wrapper/write-server-output", () => fs2.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
44382
44393
  const relativePath = relative9(indexesDir, rawServerFile).replace(/\\/g, "/");
44383
44394
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
44384
44395
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
@@ -44557,7 +44568,7 @@ if (pageHasRawStreamingSlots) {
44557
44568
  `.trim();
44558
44569
  const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
44559
44570
  const indexUnchanged = cachedWrapper?.indexHash === indexHash;
44560
- await fs2.writeFile(clientFile, hydration, "utf-8");
44571
+ await traceAngularPhase("wrapper/write-client-index", () => fs2.writeFile(clientFile, hydration, "utf-8"), { entry: resolvedEntry });
44561
44572
  wrapperOutputCache.set(resolvedEntry, {
44562
44573
  indexHash,
44563
44574
  serverHash: serverContentHash
@@ -44568,9 +44579,11 @@ if (pageHasRawStreamingSlots) {
44568
44579
  serverPath: rawServerFile
44569
44580
  };
44570
44581
  });
44571
- const results = await Promise.all(compileTasks);
44572
- const serverPaths = results.map((r) => r.serverPath);
44573
- const clientPaths = results.map((r) => r.clientPath);
44582
+ const results = await traceAngularPhase("wrapper/process-entries", () => Promise.all(compileTasks), { entries: entryPoints.length });
44583
+ const { clientPaths, serverPaths } = await traceAngularPhase("wrapper/collect-paths", () => ({
44584
+ clientPaths: results.map((r) => r.clientPath),
44585
+ serverPaths: results.map((r) => r.serverPath)
44586
+ }), { entries: results.length });
44574
44587
  return {
44575
44588
  allIndexesUnchanged: hmr && results.every((r) => r.indexUnchanged),
44576
44589
  clientPaths,
@@ -45104,7 +45117,10 @@ import {
45104
45117
  import { basename as basename7, dirname as dirname11, join as join20, relative as relative10, resolve as resolve18 } from "path";
45105
45118
  import { cwd, env as env2, exit } from "process";
45106
45119
  var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
45107
- var isDev, collectConventionSourceFiles = (entry) => {
45120
+ var isDev, isBuildTraceEnabled = () => {
45121
+ const value2 = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
45122
+ return value2 === "1" || value2 === "true" || value2 === "yes";
45123
+ }, collectConventionSourceFiles = (entry) => {
45108
45124
  if (!entry)
45109
45125
  return [];
45110
45126
  const files = [];
@@ -45430,7 +45446,68 @@ ${content.slice(firstUseIdx)}`;
45430
45446
  }) => {
45431
45447
  const buildStart = performance.now();
45432
45448
  const projectRoot = cwd();
45433
- await resolveAbsoluteVersion();
45449
+ const traceEnabled = isBuildTraceEnabled();
45450
+ const traceEvents = [];
45451
+ let traceFrameworkNames = [];
45452
+ const traceGlobal = globalThis;
45453
+ const previousTracePhase = traceGlobal.__absoluteBuildTracePhase;
45454
+ const restoreTracePhase = () => {
45455
+ if (previousTracePhase) {
45456
+ traceGlobal.__absoluteBuildTracePhase = previousTracePhase;
45457
+ } else {
45458
+ delete traceGlobal.__absoluteBuildTracePhase;
45459
+ }
45460
+ };
45461
+ const tracePhase = async (name, fn, metadata) => {
45462
+ if (!traceEnabled)
45463
+ return await fn();
45464
+ const phaseStart = performance.now();
45465
+ try {
45466
+ const result = await fn();
45467
+ traceEvents.push({
45468
+ durationMs: performance.now() - phaseStart,
45469
+ metadata,
45470
+ name,
45471
+ ok: true,
45472
+ startMs: phaseStart - buildStart
45473
+ });
45474
+ return result;
45475
+ } catch (error) {
45476
+ traceEvents.push({
45477
+ durationMs: performance.now() - phaseStart,
45478
+ metadata: {
45479
+ ...metadata,
45480
+ error: error instanceof Error ? error.message : String(error)
45481
+ },
45482
+ name,
45483
+ ok: false,
45484
+ startMs: phaseStart - buildStart
45485
+ });
45486
+ throw error;
45487
+ }
45488
+ };
45489
+ if (traceEnabled) {
45490
+ traceGlobal.__absoluteBuildTracePhase = tracePhase;
45491
+ }
45492
+ const writeBuildTrace = (buildPath2) => {
45493
+ if (!traceEnabled) {
45494
+ restoreTracePhase();
45495
+ return;
45496
+ }
45497
+ const traceDir = join20(buildPath2, ".absolute-trace");
45498
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
45499
+ mkdirSync10(traceDir, { recursive: true });
45500
+ writeFileSync7(join20(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
45501
+ events: traceEvents,
45502
+ frameworks: traceFrameworkNames,
45503
+ generatedAt: new Date().toISOString(),
45504
+ mode: mode ?? (isDev ? "development" : "production"),
45505
+ totalDurationMs: performance.now() - buildStart,
45506
+ version: 1
45507
+ }, null, 2));
45508
+ restoreTracePhase();
45509
+ };
45510
+ await tracePhase("absolute/version", () => resolveAbsoluteVersion());
45434
45511
  const isIncremental = incrementalFiles && incrementalFiles.length > 0;
45435
45512
  const styleTransformConfig = createStyleTransformConfig(stylePreprocessors, postcss);
45436
45513
  const stylePreprocessorPlugin2 = createStylePreprocessorPlugin(styleTransformConfig);
@@ -45475,6 +45552,7 @@ ${content.slice(firstUseIdx)}`;
45475
45552
  vueDir && "vue",
45476
45553
  angularDir && "angular"
45477
45554
  ].filter((name) => Boolean(name));
45555
+ traceFrameworkNames = frameworkNames;
45478
45556
  sendTelemetryEvent("build:start", {
45479
45557
  framework: frameworkNames[0],
45480
45558
  frameworks: frameworkNames,
@@ -45516,9 +45594,9 @@ ${content.slice(firstUseIdx)}`;
45516
45594
  serverOutDir = buildPath;
45517
45595
  }
45518
45596
  const publicPath = publicDirectory && validateSafePath(publicDirectory, projectRoot);
45519
- mkdirSync10(buildPath, { recursive: true });
45597
+ await tracePhase("build-dir/create", () => mkdirSync10(buildPath, { recursive: true }));
45520
45598
  if (publicPath)
45521
- cpSync(publicPath, buildPath, { force: true, recursive: true });
45599
+ await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
45522
45600
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
45523
45601
  if (!isIncremental || !incrementalFiles)
45524
45602
  return entryPoints;
@@ -45535,15 +45613,15 @@ ${content.slice(firstUseIdx)}`;
45535
45613
  return matchingEntries;
45536
45614
  };
45537
45615
  if (reactIndexesPath && reactPagesPath) {
45538
- await generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr);
45616
+ await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
45539
45617
  }
45540
45618
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/assets/")))) {
45541
- cpSync(assetsPath, join20(buildPath, "assets"), {
45619
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join20(buildPath, "assets"), {
45542
45620
  force: true,
45543
45621
  recursive: true
45544
- });
45622
+ }));
45545
45623
  }
45546
- const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? compileTailwindConfig(tailwind, buildPath, styleTransformConfig) : undefined;
45624
+ const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
45547
45625
  const emptyConventionResult = {
45548
45626
  conventions: undefined,
45549
45627
  pageFiles: []
@@ -45559,13 +45637,13 @@ ${content.slice(firstUseIdx)}`;
45559
45637
  allGlobalCssEntries
45560
45638
  ] = await Promise.all([
45561
45639
  tailwindPromise,
45562
- reactIndexesPath ? scanEntryPoints(reactIndexesPath, "*.tsx") : [],
45563
- htmlScriptsPath ? scanEntryPoints(htmlScriptsPath, "*.{js,ts}") : [],
45564
- reactPagesPath ? scanConventions(reactPagesPath, "*.tsx") : emptyConventionResult,
45565
- sveltePagesPath ? scanConventions(sveltePagesPath, "*.svelte") : emptyConventionResult,
45566
- vuePagesPath ? scanConventions(vuePagesPath, "*.vue") : emptyConventionResult,
45567
- angularPagesPath ? scanConventions(angularPagesPath, "*.ts") : emptyConventionResult,
45568
- stylesDir ? scanCssEntryPoints(stylesDir, stylesIgnore) : []
45640
+ reactIndexesPath ? tracePhase("scan/react-indexes", () => scanEntryPoints(reactIndexesPath, "*.tsx")) : [],
45641
+ htmlScriptsPath ? tracePhase("scan/html-scripts", () => scanEntryPoints(htmlScriptsPath, "*.{js,ts}")) : [],
45642
+ reactPagesPath ? tracePhase("scan/react-conventions", () => scanConventions(reactPagesPath, "*.tsx")) : emptyConventionResult,
45643
+ sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
45644
+ vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
45645
+ angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
45646
+ stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
45569
45647
  ]);
45570
45648
  const allSvelteEntries = svelteConventionResult.pageFiles;
45571
45649
  const allVueEntries = vueConventionResult.pageFiles;
@@ -45605,12 +45683,12 @@ ${content.slice(firstUseIdx)}`;
45605
45683
  htmlDir,
45606
45684
  htmxDir
45607
45685
  ].filter((dir) => Boolean(dir));
45608
- const urlReferencedFilesPromise = scanWorkerReferences(allFrameworkDirs);
45686
+ const urlReferencedFilesPromise = tracePhase("scan/worker-references", () => scanWorkerReferences(allFrameworkDirs));
45609
45687
  const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
45610
45688
  const shouldCompileVue = vueDir && vueEntries.length > 0;
45611
45689
  const shouldCompileAngular = angularDir && angularEntries.length > 0;
45612
45690
  const emptyStringArray = [];
45613
- const islandBuildInfo = islandRegistryPath ? await loadIslandRegistryBuildInfo(islandRegistryPath) : null;
45691
+ const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
45614
45692
  const islandFrameworkSources = islandBuildInfo ? collectIslandFrameworkSources(islandBuildInfo) : {};
45615
45693
  const islandSvelteSources = islandFrameworkSources.svelte ?? emptyStringArray;
45616
45694
  const islandVueSources = islandFrameworkSources.vue ?? emptyStringArray;
@@ -45626,28 +45704,28 @@ ${content.slice(firstUseIdx)}`;
45626
45704
  { vueClientPaths: islandVueClientPaths },
45627
45705
  { clientPaths: islandAngularClientPaths }
45628
45706
  ] = await Promise.all([
45629
- shouldCompileSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig)) : {
45707
+ shouldCompileSvelte ? tracePhase("compile/svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig))) : {
45630
45708
  svelteClientPaths: [...emptyStringArray],
45631
45709
  svelteIndexPaths: [...emptyStringArray],
45632
45710
  svelteServerPaths: [...emptyStringArray]
45633
45711
  },
45634
- shouldCompileVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig)) : {
45712
+ shouldCompileVue ? tracePhase("compile/vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig))) : {
45635
45713
  vueClientPaths: [...emptyStringArray],
45636
45714
  vueCssPaths: [...emptyStringArray],
45637
45715
  vueIndexPaths: [...emptyStringArray],
45638
45716
  vueServerPaths: [...emptyStringArray]
45639
45717
  },
45640
- shouldCompileAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig)) : {
45718
+ shouldCompileAngular ? tracePhase("compile/angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig))) : {
45641
45719
  clientPaths: [...emptyStringArray],
45642
45720
  serverPaths: [...emptyStringArray]
45643
45721
  },
45644
- shouldCompileIslandSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig)) : {
45722
+ shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
45645
45723
  svelteClientPaths: [...emptyStringArray]
45646
45724
  },
45647
- shouldCompileIslandVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr, styleTransformConfig)) : {
45725
+ shouldCompileIslandVue ? tracePhase("compile/island-vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr, styleTransformConfig))) : {
45648
45726
  vueClientPaths: [...emptyStringArray]
45649
45727
  },
45650
- shouldCompileIslandAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig)) : {
45728
+ shouldCompileIslandAngular ? tracePhase("compile/island-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig))) : {
45651
45729
  clientPaths: [...emptyStringArray]
45652
45730
  }
45653
45731
  ]);
@@ -45679,8 +45757,8 @@ ${content.slice(firstUseIdx)}`;
45679
45757
  const vueConventionSources = collectConventionSourceFiles(conventionsMap.vue);
45680
45758
  if (svelteConventionSources.length > 0 || vueConventionSources.length > 0) {
45681
45759
  const [svelteConvResult, vueConvResult] = await Promise.all([
45682
- svelteConventionSources.length > 0 && svelteDir ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false, styleTransformConfig)) : { svelteServerPaths: emptyStringArray },
45683
- vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, styleTransformConfig)) : { vueServerPaths: emptyStringArray }
45760
+ svelteConventionSources.length > 0 && svelteDir ? tracePhase("compile/convention-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false, styleTransformConfig))) : { svelteServerPaths: emptyStringArray },
45761
+ vueConventionSources.length > 0 && vueDir ? tracePhase("compile/convention-vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, styleTransformConfig))) : { vueServerPaths: emptyStringArray }
45684
45762
  ]);
45685
45763
  const copyConventionFiles = (framework, sources, compiledPaths) => {
45686
45764
  const destDir = join20(buildPath, "conventions", framework);
@@ -45715,7 +45793,7 @@ ${content.slice(firstUseIdx)}`;
45715
45793
  ...islandBootstrapPath ? [islandBootstrapPath] : [],
45716
45794
  ...urlReferencedFiles
45717
45795
  ];
45718
- const islandEntryResult = islandBuildInfo ? await generateIslandEntryPoints({
45796
+ const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
45719
45797
  buildInfo: islandBuildInfo,
45720
45798
  buildPath,
45721
45799
  clientPathMaps: {
@@ -45723,7 +45801,7 @@ ${content.slice(firstUseIdx)}`;
45723
45801
  svelte: islandSvelteClientPathMap,
45724
45802
  vue: islandVueClientPathMap
45725
45803
  }
45726
- }) : {
45804
+ })) : {
45727
45805
  entries: [],
45728
45806
  generatedRoot: join20(buildPath, "_island_entries")
45729
45807
  };
@@ -45757,6 +45835,7 @@ ${content.slice(firstUseIdx)}`;
45757
45835
  vue: allVueEntries.length
45758
45836
  }
45759
45837
  });
45838
+ writeBuildTrace(buildPath);
45760
45839
  return {};
45761
45840
  }
45762
45841
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
@@ -45840,7 +45919,7 @@ ${content.slice(firstUseIdx)}`;
45840
45919
  globalCssResult,
45841
45920
  vueCssResult
45842
45921
  ] = await Promise.all([
45843
- serverEntryPoints.length > 0 ? bunBuild7({
45922
+ serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7({
45844
45923
  entrypoints: serverEntryPoints,
45845
45924
  external: [
45846
45925
  "react",
@@ -45862,9 +45941,9 @@ ${content.slice(firstUseIdx)}`;
45862
45941
  target: "bun",
45863
45942
  throw: false,
45864
45943
  tsconfig: "./tsconfig.json"
45865
- }) : undefined,
45866
- reactBuildConfig ? bunBuild7(reactBuildConfig) : undefined,
45867
- nonReactClientEntryPoints.length > 0 ? bunBuild7({
45944
+ })) : undefined,
45945
+ reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
45946
+ nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7({
45868
45947
  define: vueDirectory ? vueFeatureFlags : undefined,
45869
45948
  entrypoints: nonReactClientEntryPoints,
45870
45949
  external: Object.keys(nonReactExternalPaths),
@@ -45882,8 +45961,8 @@ ${content.slice(firstUseIdx)}`;
45882
45961
  target: "browser",
45883
45962
  throw: false,
45884
45963
  tsconfig: "./tsconfig.json"
45885
- }) : undefined,
45886
- islandClientEntryPoints.length > 0 ? bunBuild7({
45964
+ })) : undefined,
45965
+ islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7({
45887
45966
  define: vueDirectory ? vueFeatureFlags : undefined,
45888
45967
  entrypoints: islandClientEntryPoints,
45889
45968
  external: Object.keys(nonReactExternalPaths),
@@ -45900,8 +45979,8 @@ ${content.slice(firstUseIdx)}`;
45900
45979
  target: "browser",
45901
45980
  throw: false,
45902
45981
  tsconfig: "./tsconfig.json"
45903
- }) : undefined,
45904
- globalCssEntries.length > 0 ? bunBuild7({
45982
+ })) : undefined,
45983
+ globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7({
45905
45984
  entrypoints: globalCssEntries,
45906
45985
  naming: `[dir]/[name].[hash].[ext]`,
45907
45986
  outdir: stylesDir ? join20(buildPath, basename7(stylesDir)) : buildPath,
@@ -45909,14 +45988,14 @@ ${content.slice(firstUseIdx)}`;
45909
45988
  root: stylesDir || clientRoot,
45910
45989
  target: "browser",
45911
45990
  throw: false
45912
- }) : undefined,
45913
- vueCssPaths.length > 0 ? bunBuild7({
45991
+ })) : undefined,
45992
+ vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7({
45914
45993
  entrypoints: vueCssPaths,
45915
45994
  naming: `[name].[hash].[ext]`,
45916
45995
  outdir: join20(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
45917
45996
  target: "browser",
45918
45997
  throw: false
45919
- }) : undefined
45998
+ })) : undefined
45920
45999
  ]);
45921
46000
  const serverLogs = serverResult?.logs ?? [];
45922
46001
  const serverOutputs = serverResult?.outputs ?? [];
@@ -45930,10 +46009,10 @@ ${content.slice(firstUseIdx)}`;
45930
46009
  }
45931
46010
  const reactClientOutputPaths = reactClientOutputs.map((artifact) => artifact.path);
45932
46011
  if (vendorPaths && reactClientOutputPaths.length > 0) {
45933
- await rewriteReactImports(reactClientOutputPaths, vendorPaths);
46012
+ await tracePhase("postprocess/react-imports", () => rewriteReactImports(reactClientOutputPaths, vendorPaths));
45934
46013
  }
45935
46014
  if (hmr && reactClientOutputPaths.length > 0) {
45936
- await patchRefreshGlobals(reactClientOutputPaths);
46015
+ await tracePhase("postprocess/react-refresh-globals", () => patchRefreshGlobals(reactClientOutputPaths));
45937
46016
  }
45938
46017
  const nonReactClientLogs = nonReactClientResult?.logs ?? [];
45939
46018
  const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
@@ -45942,16 +46021,16 @@ ${content.slice(firstUseIdx)}`;
45942
46021
  const islandClientOutputs = islandClientResult?.outputs ?? [];
45943
46022
  const islandClientOutputPaths = islandClientOutputs.map((artifact) => artifact.path);
45944
46023
  if (vendorPaths && nonReactClientOutputPaths.length > 0) {
45945
- await rewriteReactImports(nonReactClientOutputPaths, vendorPaths);
46024
+ await tracePhase("postprocess/non-react-react-imports", () => rewriteReactImports(nonReactClientOutputPaths, vendorPaths));
45946
46025
  }
45947
46026
  if (hmr && nonReactClientOutputPaths.length > 0) {
45948
- await patchRefreshGlobals(nonReactClientOutputPaths);
46027
+ await tracePhase("postprocess/non-react-refresh-globals", () => patchRefreshGlobals(nonReactClientOutputPaths));
45949
46028
  }
45950
46029
  if (vendorPaths && islandClientOutputPaths.length > 0) {
45951
- await rewriteReactImports(islandClientOutputPaths, vendorPaths);
46030
+ await tracePhase("postprocess/island-react-imports", () => rewriteReactImports(islandClientOutputPaths, vendorPaths));
45952
46031
  }
45953
46032
  if (hmr && islandClientOutputPaths.length > 0) {
45954
- await patchRefreshGlobals(islandClientOutputPaths);
46033
+ await tracePhase("postprocess/island-refresh-globals", () => patchRefreshGlobals(islandClientOutputPaths));
45955
46034
  }
45956
46035
  if (nonReactClientResult && !nonReactClientResult.success && nonReactClientLogs.length > 0) {
45957
46036
  extractBuildError(nonReactClientLogs, "non-react-client", "Non-React client", frameworkNames, isIncremental, throwOnError);
@@ -45971,11 +46050,11 @@ ${content.slice(firstUseIdx)}`;
45971
46050
  };
45972
46051
  if (nonReactClientOutputs.length > 0 && Object.keys(allNonReactVendorPaths).length > 0) {
45973
46052
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
45974
- await rewriteImports2(nonReactClientOutputs.map((artifact) => artifact.path), allNonReactVendorPaths);
46053
+ await tracePhase("postprocess/non-react-vendor-imports", () => rewriteImports2(nonReactClientOutputs.map((artifact) => artifact.path), allNonReactVendorPaths));
45975
46054
  }
45976
46055
  if (islandClientOutputs.length > 0 && Object.keys(allIslandVendorPaths).length > 0) {
45977
46056
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
45978
- await rewriteImports2(islandClientOutputs.map((artifact) => artifact.path), allIslandVendorPaths);
46057
+ await tracePhase("postprocess/island-vendor-imports", () => rewriteImports2(islandClientOutputs.map((artifact) => artifact.path), allIslandVendorPaths));
45979
46058
  }
45980
46059
  const cssLogs = [
45981
46060
  ...globalCssResult?.logs ?? [],
@@ -45997,11 +46076,11 @@ ${content.slice(firstUseIdx)}`;
45997
46076
  ];
45998
46077
  if (urlReferencedFiles.length > 0) {
45999
46078
  const urlFileMap = buildUrlFileMap(urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs);
46000
- rewriteUrlReferences(allClientOutputPaths, urlFileMap);
46079
+ await tracePhase("postprocess/url-references", () => rewriteUrlReferences(allClientOutputPaths, urlFileMap));
46001
46080
  }
46002
46081
  const vueOutputPaths = nonReactClientOutputs.map((artifact) => artifact.path).filter((path2) => path2.includes("/vue/"));
46003
46082
  if (hmr && vueDirectory) {
46004
- vueOutputPaths.forEach((outputPath) => injectVueComposableTracking(outputPath, projectRoot));
46083
+ await tracePhase("postprocess/vue-hmr", () => vueOutputPaths.forEach((outputPath) => injectVueComposableTracking(outputPath, projectRoot)));
46005
46084
  }
46006
46085
  const allLogs = [
46007
46086
  ...serverLogs,
@@ -46091,18 +46170,21 @@ ${content.slice(firstUseIdx)}`;
46091
46170
  manifest[fileName] = htmxFile;
46092
46171
  }
46093
46172
  };
46094
- await Promise.all([processHtmlPages(), processHtmxPages()]);
46173
+ await Promise.all([
46174
+ tracePhase("postprocess/html-pages", processHtmlPages),
46175
+ tracePhase("postprocess/htmx-pages", processHtmxPages)
46176
+ ]);
46095
46177
  if (!isIncremental) {
46096
- await cleanStaleOutputs(buildPath, [
46178
+ await tracePhase("cleanup/stale-outputs", () => cleanStaleOutputs(buildPath, [
46097
46179
  ...serverOutputs.map((a) => a.path),
46098
46180
  ...reactClientOutputs.map((a) => a.path),
46099
46181
  ...nonReactClientOutputs.map((a) => a.path),
46100
46182
  ...islandClientOutputs.map((a) => a.path),
46101
46183
  ...cssOutputs.map((a) => a.path)
46102
- ]);
46184
+ ]));
46103
46185
  }
46104
46186
  if (hmr) {
46105
- await copyDevIndexes({
46187
+ await tracePhase("dev/copy-indexes", () => copyDevIndexes({
46106
46188
  buildPath,
46107
46189
  reactIndexesPath,
46108
46190
  reactPagesPath,
@@ -46112,14 +46194,14 @@ ${content.slice(firstUseIdx)}`;
46112
46194
  vueDir,
46113
46195
  vueEntries,
46114
46196
  vuePagesPath
46115
- });
46197
+ }));
46116
46198
  }
46117
- await cleanup({
46199
+ await tracePhase("cleanup/generated", () => cleanup({
46118
46200
  angularDir,
46119
46201
  reactDir,
46120
46202
  svelteDir,
46121
46203
  vueDir
46122
- });
46204
+ }));
46123
46205
  if (!isIncremental) {
46124
46206
  globalThis.__hmrBuildDuration = performance.now() - buildStart;
46125
46207
  }
@@ -46128,12 +46210,15 @@ ${content.slice(firstUseIdx)}`;
46128
46210
  frameworks: frameworkNames,
46129
46211
  mode: mode ?? (isDev ? "development" : "production")
46130
46212
  });
46131
- if (isIncremental)
46213
+ if (isIncremental) {
46214
+ writeBuildTrace(buildPath);
46132
46215
  return { conventions: conventionsMap, manifest };
46216
+ }
46133
46217
  writeFileSync7(join20(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
46134
46218
  if (Object.keys(conventionsMap).length > 0) {
46135
46219
  writeFileSync7(join20(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
46136
46220
  }
46221
+ writeBuildTrace(buildPath);
46137
46222
  return { conventions: conventionsMap, manifest };
46138
46223
  };
46139
46224
  var init_build = __esm(() => {
@@ -50128,5 +50213,5 @@ export {
50128
50213
  build
50129
50214
  };
50130
50215
 
50131
- //# debugId=7C0EA9CE9BD464E064756E2164756E21
50216
+ //# debugId=361E23C79CF9F13864756E2164756E21
50132
50217
  //# sourceMappingURL=build.js.map