@absolutejs/absolute 0.19.0-beta.1019 → 0.19.0-beta.1020

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.
@@ -4497,9 +4497,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4497
4497
  const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
4498
4498
  const providersHashInput = providersInjection ? (() => {
4499
4499
  let providersSourceContent = "";
4500
- try {
4501
- providersSourceContent = readFileSync5(providersInjection.appProvidersSource, "utf-8");
4502
- } catch {}
4500
+ if (providersInjection.appProvidersSource) {
4501
+ try {
4502
+ providersSourceContent = readFileSync5(providersInjection.appProvidersSource, "utf-8");
4503
+ } catch {}
4504
+ }
4503
4505
  return JSON.stringify({
4504
4506
  basePath: pageInjectionForHash?.basePath ?? null,
4505
4507
  hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
@@ -4536,20 +4538,22 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4536
4538
  const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
4537
4539
  rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
4538
4540
  if (providersInjection && pageInjection) {
4539
- const compiledAppProvidersPath = (() => {
4540
- const angularDirAbs = resolve6(outRoot);
4541
- const appSourceAbs = resolve6(providersInjection.appProvidersSource);
4542
- const rel = relative4(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
4543
- return join7(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
4544
- })();
4545
- const appProvidersSpec = (() => {
4546
- const rel = relative4(dirname4(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
4547
- return rel.startsWith(".") ? rel : `./${rel}`;
4548
- })();
4549
- const importLines = [
4550
- `import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`
4551
- ];
4552
- const fragments = ["...__abs_globalProviders"];
4541
+ const importLines = [];
4542
+ const fragments = [];
4543
+ if (providersInjection.appProvidersSource) {
4544
+ const compiledAppProvidersPath = (() => {
4545
+ const angularDirAbs = resolve6(outRoot);
4546
+ const appSourceAbs = resolve6(providersInjection.appProvidersSource);
4547
+ const rel = relative4(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
4548
+ return join7(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
4549
+ })();
4550
+ const appProvidersSpec = (() => {
4551
+ const rel = relative4(dirname4(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
4552
+ return rel.startsWith(".") ? rel : `./${rel}`;
4553
+ })();
4554
+ importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
4555
+ fragments.push("...__abs_globalProviders");
4556
+ }
4553
4557
  if (pageInjection.hasRoutes) {
4554
4558
  importLines.push(`import { provideRouter as __abs_provideRouter, withComponentInputBinding as __abs_withComponentInputBinding, withViewTransitions as __abs_withViewTransitions } from "@angular/router";`);
4555
4559
  fragments.push("__abs_provideRouter(routes, __abs_withComponentInputBinding(), __abs_withViewTransitions())");
@@ -4558,13 +4562,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4558
4562
  importLines.push(`import { APP_BASE_HREF as __abs_APP_BASE_HREF } from "@angular/common";`);
4559
4563
  fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
4560
4564
  }
4561
- rewritten += `
4565
+ if (fragments.length > 0) {
4566
+ rewritten += `
4562
4567
  /* __ABS_PROVIDERS_INJECTION_START */
4563
4568
  ${importLines.join(`
4564
4569
  `)}
4565
4570
  export const providers = [${fragments.join(", ")}];
4566
4571
  /* __ABS_PROVIDERS_INJECTION_END */
4567
4572
  `;
4573
+ }
4568
4574
  }
4569
4575
  await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
4570
4576
  const relativePath = relative4(indexesDir, rawServerFile).replace(/\\/g, "/");
@@ -6012,5 +6018,5 @@ export {
6012
6018
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
6013
6019
  };
6014
6020
 
6015
- //# debugId=4CDAD5FB05DE27E564756E2164756E21
6021
+ //# debugId=8E308DFD1FCF0BC964756E2164756E21
6016
6022
  //# sourceMappingURL=server.js.map