@vanilla-extract/rollup-plugin
Version:
Zero-runtime Stylesheets-in-TypeScript
54 lines (51 loc) • 1.88 kB
TypeScript
import { Plugin } from 'rollup';
import { IdentifierOption, CompileOptions } from '@vanilla-extract/integration';
interface Options {
/**
* Different formatting of identifiers (e.g. class names, keyframes, CSS Vars, etc) can be configured by selecting from the following options:
* - "short": 7+ character hash. e.g. hnw5tz3
* - "debug": human readable prefixes representing the owning filename and a potential rule level debug name. e.g. myfile_mystyle_hnw5tz3
* - custom function: takes an object parameter with `hash`, `filePath`, `debugId`, and `packageName`, and returns a customized identifier.
* @default "short"
* @example ({ hash }) => `prefix_${hash}`
*/
identifiers?: IdentifierOption;
/**
* Current working directory
* @default process.cwd()
*/
cwd?: string;
/**
* Options forwarded to esbuild
* @see https://esbuild.github.io/
*/
esbuildOptions?: CompileOptions['esbuildOptions'];
/**
* Extract .css bundle to a specified filename
* @default false
*/
extract?: {
/**
* Name of emitted .css file.
* @default "bundle.css"
*/
name?: string;
/**
* Generate a .css.map file?
* @default false
*/
sourcemap?: boolean;
} | false;
/**
* Inject filescopes into Vanilla Extract modules instead of generating CSS.
* Useful for utility or component libraries that prefer their consumers to
* process Vanilla Extract files instead of bundling CSS.
*
* Only works with `preserveModules: true`.
*
* @default false
*/
unstable_injectFilescopes?: boolean;
}
declare function vanillaExtractPlugin({ identifiers, cwd, esbuildOptions, extract, unstable_injectFilescopes, }?: Options): Plugin;
export { type Options, vanillaExtractPlugin };