@absolutejs/absolute 0.19.0-beta.846 → 0.19.0-beta.847

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.
@@ -754,6 +754,18 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
754
754
  return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
755
755
  }
756
756
  return compileStyleSource(filePath, undefined, undefined, config);
757
+ }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
758
+ return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
759
+ const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
760
+ if (visited.has(fullPath))
761
+ return "";
762
+ if (!existsSync2(fullPath))
763
+ return match;
764
+ const nextVisited = new Set(visited);
765
+ nextVisited.add(fullPath);
766
+ const imported = readFileSync2(fullPath, "utf-8");
767
+ return resolveCssImportsSync(imported, dirname(fullPath), nextVisited);
768
+ });
757
769
  }, compileStyleFileIfNeededSync = (filePath, config) => {
758
770
  const rawContents = readFileSync2(filePath, "utf-8");
759
771
  const language = getStyleLanguage(filePath);
@@ -771,7 +783,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
771
783
  }
772
784
  const contents = withAdditionalData(rawContents, options.additionalData);
773
785
  const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
774
- return sass.compileString(contents, {
786
+ const compiled = sass.compileString(contents, {
775
787
  importers: [
776
788
  createSassImporter(filePath, loadPaths, language, config)
777
789
  ],
@@ -780,6 +792,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
780
792
  syntax: language === "sass" ? "indented" : "scss",
781
793
  url: new URL(`file://${filePath}`)
782
794
  }).css;
795
+ return resolveCssImportsSync(compiled, dirname(filePath), new Set([filePath]));
783
796
  }
784
797
  if (language === "less") {
785
798
  throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
@@ -787,7 +800,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
787
800
  if (language === "stylus") {
788
801
  throw new Error(`Unable to compile ${filePath}: Stylus styleUrl preprocessing is async-only. Import the Stylus file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
789
802
  }
790
- return rawContents;
803
+ return resolveCssImportsSync(rawContents, dirname(filePath), new Set([filePath]));
791
804
  }, getCssOutputExtension = (filePath) => isPreprocessableStylePath(filePath) ? ".css" : extname(filePath);
792
805
  var init_stylePreprocessor = __esm(() => {
793
806
  CSS_EXTENSION_PATTERN = /\.css$/i;
@@ -800,6 +813,7 @@ var init_stylePreprocessor = __esm(() => {
800
813
  styleDependencyGraph = new Map;
801
814
  styleOutputHashes = new Map;
802
815
  stylePreprocessorPlugin = createStylePreprocessorPlugin();
816
+ CSS_IMPORT_PATTERN = /@import\s+["']([^"']+)["']\s*;?/g;
803
817
  });
804
818
 
805
819
  // src/core/svelteServerModule.ts
@@ -3772,5 +3786,5 @@ export {
3772
3786
  createTypedIsland
3773
3787
  };
3774
3788
 
3775
- //# debugId=A6579D02DBD1FDED64756E2164756E21
3789
+ //# debugId=E4D8E2ADF4965B6964756E2164756E21
3776
3790
  //# sourceMappingURL=index.js.map