@absolutejs/absolute 0.19.0-beta.995 → 0.19.0-beta.996

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/index.js CHANGED
@@ -13251,23 +13251,19 @@ var resolveDevClientDir3 = () => {
13251
13251
  return "template-only";
13252
13252
  }
13253
13253
  return "full";
13254
- }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), hoistCssImports = (css) => {
13255
- const importRegex = /@import\s+[^;]+;\s*\n?/g;
13256
- const imports = [];
13257
- const seen = new Set;
13258
- const stripped = css.replace(importRegex, (match) => {
13259
- const normalised = match.trim();
13260
- if (seen.has(normalised))
13261
- return "";
13262
- seen.add(normalised);
13263
- imports.push(normalised);
13254
+ }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
13255
+ const resolved = realpathSync(cssFilePath);
13256
+ if (visited.has(resolved))
13264
13257
  return "";
13258
+ visited.add(resolved);
13259
+ const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
13260
+ return cssContent.replace(importRegex, (match, _quote, relPath) => {
13261
+ const importedPath = resolve23(dirname15(cssFilePath), relPath);
13262
+ if (!existsSync22(importedPath))
13263
+ return match;
13264
+ const importedContent = readFileSync19(importedPath, "utf-8");
13265
+ return inlineCssImports(importedContent, importedPath, visited);
13265
13266
  });
13266
- if (imports.length === 0)
13267
- return css;
13268
- return `${imports.join(`
13269
- `)}
13270
- ${stripped}`;
13271
13267
  }, resolveHelperTsPath = (sourceDir, helper) => {
13272
13268
  if (helper.endsWith(".ts"))
13273
13269
  return resolve23(sourceDir, helper);
@@ -13406,13 +13402,16 @@ ${stripped}`;
13406
13402
  }).code;
13407
13403
  return transpiler4.transformSync(rendered).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
13408
13404
  };
13409
- const localCss = await Promise.all(descriptor.styles.map(async (styleBlock) => compiler.compileStyle({
13410
- filename: sourceFilePath,
13411
- id: componentId,
13412
- scoped: styleBlock.scoped,
13413
- source: styleBlock.lang ? await compileStyleSource(sourceFilePath, styleBlock.content, styleBlock.lang, stylePreprocessors) : styleBlock.content,
13414
- trim: true
13415
- }).code));
13405
+ const localCss = await Promise.all(descriptor.styles.map(async (styleBlock) => {
13406
+ const rawContent = styleBlock.lang ? await compileStyleSource(sourceFilePath, styleBlock.content, styleBlock.lang, stylePreprocessors) : styleBlock.content;
13407
+ return compiler.compileStyle({
13408
+ filename: sourceFilePath,
13409
+ id: componentId,
13410
+ scoped: styleBlock.scoped,
13411
+ source: inlineCssImports(rawContent, sourceFilePath),
13412
+ trim: true
13413
+ }).code;
13414
+ }));
13416
13415
  const allCss = [
13417
13416
  ...localCss,
13418
13417
  ...childBuildResults.flatMap((result2) => result2.cssCodes)
@@ -13421,8 +13420,8 @@ ${stripped}`;
13421
13420
  if (isEntryPoint && allCss.length) {
13422
13421
  const cssOutputFile = join28(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
13423
13422
  await mkdir5(dirname15(cssOutputFile), { recursive: true });
13424
- await write3(cssOutputFile, hoistCssImports(allCss.join(`
13425
- `)));
13423
+ await write3(cssOutputFile, allCss.join(`
13424
+ `));
13426
13425
  cssOutputPaths = [cssOutputFile];
13427
13426
  }
13428
13427
  const assembleModule = (renderCode, renderFnName, includeHmr) => {
@@ -35698,5 +35697,5 @@ export {
35698
35697
  ANGULAR_INIT_TIMEOUT_MS
35699
35698
  };
35700
35699
 
35701
- //# debugId=66735B5F990E713564756E2164756E21
35700
+ //# debugId=B15B054E1CF0882664756E2164756E21
35702
35701
  //# sourceMappingURL=index.js.map