index.d.ts 871 B

123456789101112131415161718192021222324
  1. import type { Plugin as VitePlugin } from 'vite';
  2. /** Electron Renderer process code snippets */
  3. export declare const electron: string;
  4. export interface RendererOptions {
  5. /**
  6. * Explicitly tell Vite how to load modules, which is very useful for C/C++ and `esm` modules
  7. *
  8. * - `type.cjs` just wraps esm-interop
  9. * - `type.esm` pre-bundle to `cjs` and wraps esm-interop
  10. *
  11. * @experimental
  12. */
  13. resolve?: {
  14. [module: string]: {
  15. type: 'cjs' | 'esm';
  16. /** Full custom how to pre-bundle */
  17. build?: (args: {
  18. cjs: (module: string) => Promise<string>;
  19. esm: (module: string, buildOptions?: import('esbuild').BuildOptions) => Promise<string>;
  20. }) => Promise<string>;
  21. };
  22. };
  23. }
  24. export default function renderer(options?: RendererOptions): VitePlugin;