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

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/vue/index.js CHANGED
@@ -2401,12 +2401,42 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2401
2401
  code: await compileStyleSource(path, content, language, config)
2402
2402
  };
2403
2403
  }
2404
- }), compileStyleFileIfNeeded = async (filePath, config) => {
2404
+ }), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
2405
+ const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
2406
+ if (matches.length === 0)
2407
+ return content;
2408
+ let cursor = 0;
2409
+ const parts = [];
2410
+ for (const match of matches) {
2411
+ const importPath = match[1];
2412
+ if (importPath === undefined)
2413
+ continue;
2414
+ const start = match.index ?? 0;
2415
+ const end = start + match[0].length;
2416
+ parts.push(content.slice(cursor, start));
2417
+ const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
2418
+ if (visited.has(fullPath) || !existsSync3(fullPath)) {
2419
+ parts.push(visited.has(fullPath) ? "" : match[0]);
2420
+ cursor = end;
2421
+ continue;
2422
+ }
2423
+ const nextVisited = new Set(visited);
2424
+ nextVisited.add(fullPath);
2425
+ const imported = await readFile(fullPath, "utf-8");
2426
+ parts.push(await resolveCssImportsAsync(imported, dirname2(fullPath), nextVisited));
2427
+ cursor = end;
2428
+ }
2429
+ parts.push(content.slice(cursor));
2430
+ return parts.join("");
2431
+ }, compileStyleFileIfNeeded = async (filePath, config) => {
2405
2432
  if (!isPreprocessableStylePath(filePath)) {
2406
- return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
2433
+ const raw = await readFile(filePath, "utf-8");
2434
+ const processed = await runPostcss(raw, filePath, config);
2435
+ return resolveCssImportsAsync(processed, dirname2(filePath), new Set([filePath]));
2407
2436
  }
2408
- return compileStyleSource(filePath, undefined, undefined, config);
2409
- }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
2437
+ const compiled = await compileStyleSource(filePath, undefined, undefined, config);
2438
+ return resolveCssImportsAsync(compiled, dirname2(filePath), new Set([filePath]));
2439
+ }, resolveCssImportsSync = (content, baseDir, visited) => {
2410
2440
  return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
2411
2441
  const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
2412
2442
  if (visited.has(fullPath))
@@ -4382,5 +4412,5 @@ export {
4382
4412
  Image
4383
4413
  };
4384
4414
 
4385
- //# debugId=FF18F3AE9B56CF9D64756E2164756E21
4415
+ //# debugId=42EC1EA27AF7364864756E2164756E21
4386
4416
  //# sourceMappingURL=index.js.map