UNPKG

1.33 kBTypeScriptView Raw
1import { Plugin } from 'rollup';
2import { TransformOptions, BuildOptions, Loader } from 'esbuild';
3import { FilterPattern } from '@rollup/pluginutils';
4
5declare type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
6
7type Options$1 = Omit<TransformOptions, 'sourcemap'> & {
8 sourceMap?: boolean;
9};
10declare const minify: ({ sourceMap, ...options }?: Options$1) => Plugin;
11
12type OptimizeDepsOptions = {
13 include: string[];
14 exclude?: string[];
15 cwd: string;
16 esbuildOptions?: BuildOptions;
17 sourceMap: boolean;
18};
19
20type Options = Omit<TransformOptions, 'sourcemap' | 'loader'> & {
21 include?: FilterPattern;
22 exclude?: FilterPattern;
23 sourceMap?: boolean;
24 optimizeDeps?: MarkOptional<OptimizeDepsOptions, 'cwd' | 'sourceMap'>;
25 /**
26 * Use this tsconfig file instead
27 * Disable it by setting to `false`
28 */
29 tsconfig?: string | false;
30 /**
31 * Map extension to esbuild loader
32 * Note that each entry (the extension) needs to start with a dot
33 */
34 loaders?: {
35 [ext: string]: Loader | false;
36 };
37};
38declare const _default: ({ include, exclude, sourceMap, optimizeDeps, tsconfig, loaders: _loaders, ...esbuildOptions }?: Options) => Plugin;
39
40export { Options, _default as default, minify };