interfaces.d.ts 736 B

1234567891011121314151617181920
  1. import { transform, TransformOptions } from 'esbuild';
  2. type Filter = string | RegExp;
  3. type Implementation = {
  4. transform: typeof transform;
  5. };
  6. type Except<ObjectType, Properties> = {
  7. [Key in keyof ObjectType as (Key extends Properties ? never : Key)]: ObjectType[Key];
  8. };
  9. type LoaderOptions = Except<TransformOptions, 'sourcemap' | 'sourcefile'> & {
  10. /** Pass a custom esbuild implementation */
  11. implementation?: Implementation;
  12. };
  13. type MinifyPluginOptions = Except<TransformOptions, 'sourcefile'> & {
  14. include?: Filter | Filter[];
  15. exclude?: Filter | Filter[];
  16. css?: boolean;
  17. /** Pass a custom esbuild implementation */
  18. implementation?: Implementation;
  19. };
  20. export { LoaderOptions, MinifyPluginOptions, };