/** * CSS Import Extraction * * Pure helpers for discovering CSS files imported by project source modules * (side-effect imports like `import "./styles.css"` in app/layout.tsx, `@/` * alias imports, and CSS module imports). * * The production SSR pipeline collects CSS imports while loading modules and * merges them into the page stylesheet. Two other stylesheet producers have no * module-loading pass and recover the same information with these helpers: * the dev/preview /_vf_styles/styles.css route and the release-asset build * executor. * * Extraction is intentionally text-based (like Tailwind candidate scanning): * it must stay cheap enough to run on every stylesheet compile and must not * depend on bundler/parser extensions being registered. Unresolvable or * unreadable specifiers are skipped downstream, so over-matching is harmless. * * @module html/styles-builder/css-import-extraction */ /** Module extensions whose sources can carry CSS imports. */ export declare const CSS_IMPORTING_SOURCE_EXTENSIONS: string[]; /** * Extract the raw specifiers of all CSS imports in a source file. * * Deliberately loose, per this module's contract: over-matching is harmless * because unresolvable specifiers are skipped downstream. A commented-out or * quoted `import "./x.css"` will be reported, and that is fine. * * An earlier revision blanked comments, template literals and fenced blocks * before matching, because the release-asset build had made this function's * output fatal. That was the wrong layer to fix it: telling code from prose * with a regex kept finding new holes, and worse, an unpaired `/*` or backtick * blanked across intervening real code and silently dropped a genuine import -- * trading a loud failure for a page shipped without its stylesheet. The build * no longer gaps on what it cannot resolve, so the looseness costs nothing. */ export declare function extractCssImportSpecifiers(source: string): string[]; /** * Resolve a CSS import specifier to an absolute project path. * Supports `./`/`../` (relative to the importing file) and the `@/` project * alias. Bare and URL specifiers are ignored. Returns null when the resolved * path would escape the project directory. */ export declare function resolveCssImportPath(specifier: string, importerPath: string, projectDir: string): string | null; /** * Collect the resolved absolute paths of all CSS files imported by the given * source files, deduplicated and sorted for deterministic output. */ export declare function collectCssImportPaths(files: Iterable<{ path: string; content: string; }>, projectDir: string): string[]; //# sourceMappingURL=css-import-extraction.d.ts.map