index.d.ts 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Plugin } from 'vite';
  2. interface Options {
  3. /**
  4. * default: 'defaults'
  5. */
  6. targets?: string | string[] | {
  7. [key: string]: string;
  8. };
  9. /**
  10. * default: false
  11. */
  12. ignoreBrowserslistConfig?: boolean;
  13. /**
  14. * default: true
  15. */
  16. polyfills?: boolean | string[];
  17. additionalLegacyPolyfills?: string[];
  18. /**
  19. * default: false
  20. */
  21. modernPolyfills?: boolean | string[];
  22. /**
  23. * default: true
  24. */
  25. renderLegacyChunks?: boolean;
  26. /**
  27. * default: false
  28. */
  29. externalSystemJS?: boolean;
  30. /**
  31. * default: true
  32. */
  33. renderModernChunks?: boolean;
  34. }
  35. declare function viteLegacyPlugin(options?: Options): Plugin[];
  36. declare function detectPolyfills(code: string, targets: any, list: Set<string>): Promise<void>;
  37. declare const cspHashes: string[];
  38. export { cspHashes, viteLegacyPlugin as default, detectPolyfills };