1 | import { TransformOptions, transform } from 'esbuild';
|
2 |
|
3 | type Filter = string | RegExp;
|
4 |
|
5 | type Implementation = {
|
6 | transform: typeof transform;
|
7 | };
|
8 |
|
9 | type Except<ObjectType, Properties> = {
|
10 | [Key in keyof ObjectType as (Key extends Properties ? never : Key)]: ObjectType[Key];
|
11 | };
|
12 |
|
13 | type LoaderOptions = Except<TransformOptions, 'sourcemap' | 'sourcefile'> & {
|
14 |
|
15 | implementation?: Implementation;
|
16 |
|
17 | |
18 |
|
19 |
|
20 | tsconfig?: string;
|
21 | };
|
22 |
|
23 | type EsbuildPluginOptions = Except<TransformOptions, 'sourcemap' | 'sourcefile'> & {
|
24 | include?: Filter | Filter[];
|
25 | exclude?: Filter | Filter[];
|
26 | css?: boolean;
|
27 |
|
28 | implementation?: Implementation;
|
29 | };
|
30 |
|
31 | declare class EsbuildPlugin {
|
32 | constructor(options?: EsbuildPluginOptions);
|
33 |
|
34 | apply(compiler: any): void;
|
35 | }
|
36 |
|
37 | export { EsbuildPlugin, EsbuildPluginOptions, LoaderOptions };
|