import type { Plugin } from 'vite'; /** * Strips block comments (`/* … *\/`) from inside `css\`…\`` tagged templates. * * Why this exists: esbuild minifies JavaScript, but the body of a tagged template is a string * literal, so a CSS comment written inside `css\`…\`` is shipped verbatim to every consumer. The * design notes that explain a style rule belong in the source, not in the bundle — they cost * gzip bytes against the size budget and leak internal context into a public artifact. * * Deliberately narrow: only `css\`` templates (not `html\``, whose whitespace is significant to * rendering), only block comments, and never a comment that contains `${` — inside a template * literal that is still an expression, not comment text, and rewriting it would change behavior. * Each removed comment is replaced by the newlines it contained, so line numbers in the source * map stay aligned. */ export declare function stripCssTemplateComments(source: string): string; /** * Vite plugin: strips block comments from `css` tagged templates in the package's own sources before esbuild * sees them (see `stripCssTemplateComments`). * * Only the package's `src/**` TypeScript that is not a test is touched — the transform's own fixtures live in * tests, and a dependency's code is not ours to rewrite. Use it in every package that ships Lit styles: * * ```ts * import stripCssComments from '@iyulab/components/plugins/vite-plugin-strip-css-comments.js'; * export default defineConfig({ plugins: [stripCssComments()] }); * ``` */ export default function stripCssComments(): Plugin;