@absolutejs/absolute 0.19.0-beta.1000 → 0.19.0-beta.1002

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.
@@ -5147,6 +5147,34 @@ var injectIslandPageContextStream = (stream, options) => {
5147
5147
  var setCurrentIslandManifest = (manifest) => {
5148
5148
  globalThis.__absoluteManifest = manifest;
5149
5149
  };
5150
+
5151
+ // src/utils/inlinePageCss.ts
5152
+ var siblingCssCache = new Map;
5153
+ var readSiblingCss = async (siblingJsPath) => {
5154
+ if (!siblingJsPath)
5155
+ return "";
5156
+ const cssPath = siblingJsPath.replace(/\.js$/, ".css");
5157
+ if (cssPath === siblingJsPath)
5158
+ return "";
5159
+ const cached = siblingCssCache.get(cssPath);
5160
+ if (cached !== undefined)
5161
+ return cached;
5162
+ const { readFile } = await import("fs/promises");
5163
+ try {
5164
+ const css = await readFile(cssPath, "utf-8");
5165
+ siblingCssCache.set(cssPath, css);
5166
+ return css;
5167
+ } catch {
5168
+ siblingCssCache.set(cssPath, "");
5169
+ return "";
5170
+ }
5171
+ };
5172
+ var injectInlineCss = (headTag, css) => {
5173
+ if (!css)
5174
+ return headTag;
5175
+ const styleBlock = `<style data-absolute-page-css>${css}</style>`;
5176
+ return headTag.replace("</head>", `${styleBlock}</head>`);
5177
+ };
5150
5178
  // src/utils/resolveConvention.ts
5151
5179
  import { basename } from "path";
5152
5180
  var CONVENTIONS_KEY = "__absoluteConventions";
@@ -5875,13 +5903,15 @@ var handleAngularPageRequest = async (input) => {
5875
5903
  const requestId = `angular_${Date.now()}_${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
5876
5904
  return angularSsrContext.run(requestId, async () => {
5877
5905
  await ensureAngularCompiler();
5878
- const resolvedHeadTag = input.headTag ?? "<head></head>";
5906
+ const userHeadTag = input.headTag ?? "<head></head>";
5879
5907
  const resolvedIndexPath = input.indexPath;
5880
5908
  const options = input;
5881
5909
  const resolvedPagePath = input.pagePath;
5882
5910
  const maybeRequestContext = input.requestContext;
5883
5911
  const responseInit = input.responseInit ?? {};
5884
5912
  const resolvedUrl = resolveRequestRenderUrl(input.request);
5913
+ const siblingCss = await readSiblingCss(resolvedPagePath);
5914
+ const resolvedHeadTag = injectInlineCss(userHeadTag, siblingCss);
5885
5915
  cacheRouteData(resolvedPagePath, {
5886
5916
  headTag: resolvedHeadTag,
5887
5917
  requestContext: maybeRequestContext
@@ -5960,5 +5990,5 @@ export {
5960
5990
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
5961
5991
  };
5962
5992
 
5963
- //# debugId=AEF6FBA51C59AAB664756E2164756E21
5993
+ //# debugId=1F30D2299BE3E7A064756E2164756E21
5964
5994
  //# sourceMappingURL=server.js.map