UNPKG

esbuild-loader

Version:

⚡️ Speed up your Webpack build with esbuild

41 lines (29 loc) 953 B
import { TransformOptions, transform } from 'esbuild'; type Filter = string | RegExp; type Implementation = { transform: typeof transform; }; type Except<ObjectType, Properties> = { [Key in keyof ObjectType as (Key extends Properties ? never : Key)]: ObjectType[Key]; }; type LoaderOptions = Except<TransformOptions, 'sourcemap' | 'sourcefile'> & { /** Pass a custom esbuild implementation */ implementation?: Implementation; /** * Path to tsconfig.json file */ tsconfig?: string; }; type EsbuildPluginOptions = Except<TransformOptions, 'sourcemap' | 'sourcefile'> & { include?: Filter | Filter[]; exclude?: Filter | Filter[]; css?: boolean; /** Pass a custom esbuild implementation */ implementation?: Implementation; }; declare class EsbuildPlugin { constructor(options?: EsbuildPluginOptions); apply(): void; } export { EsbuildPlugin }; export type { EsbuildPluginOptions, Except, Filter, Implementation, LoaderOptions };