UNPKG

1.54 kBTypeScriptView Raw
1/// <reference types="node" />
2import { CreateFilter } from 'rollup-pluginutils';
3import type { Plugin } from 'rollup';
4export interface CSSPluginOptions {
5 exclude?: Parameters<CreateFilter>[1];
6 failOnError?: boolean;
7 /** Literal asset filename, bypasses any hashes in the filename */
8 fileName?: string;
9 include?: Parameters<CreateFilter>[0];
10 includePaths?: string[];
11 insert?: boolean;
12 /** Asset name, defaults to output.css, Rollup may add a hash to this! Check out RollupConfig.output.assetFileNames */
13 name?: string;
14 /** @deprecated Use `fileName` instead, currently still available for backwards compatibility */
15 output?: string | false | ((css: string, styles: Styles) => void);
16 prefix?: string;
17 processor?: (css: string, map: string, styles: Styles) => CSS | Promise<CSS> | PostCSSProcessor;
18 sass?: SassRenderer;
19 sourceMap?: boolean;
20 verbose?: boolean;
21 watch?: string | string[];
22 outputStyle?: string;
23}
24type CSS = string | {
25 css: string;
26 map: string;
27};
28interface MappedCSS {
29 css: string;
30 map: string;
31}
32interface Styles {
33 [id: string]: string;
34}
35interface PostCSSProcessor {
36 process: (css: string, options?: any) => MappedCSS;
37}
38interface SassRenderer {
39 renderSync: (options: SassOptions) => SassResult;
40}
41interface SassOptions {
42 data: string;
43}
44interface SassResult {
45 css: Buffer;
46 map?: Buffer;
47}
48export default function scss(options?: CSSPluginOptions): Plugin;
49export {};