index.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Plugin as Plugin_2 } from 'vite';
  2. import { SFCScriptCompileOptions } from '@vue/compiler-sfc';
  3. import { SFCStyleCompileOptions } from '@vue/compiler-sfc';
  4. import { SFCTemplateCompileOptions } from '@vue/compiler-sfc';
  5. import { ViteDevServer } from 'vite';
  6. export declare interface Options {
  7. include?: string | RegExp | (string | RegExp)[];
  8. exclude?: string | RegExp | (string | RegExp)[];
  9. isProduction?: boolean;
  10. script?: Partial<SFCScriptCompileOptions>;
  11. template?: Partial<SFCTemplateCompileOptions>;
  12. style?: Partial<SFCStyleCompileOptions>;
  13. /**
  14. * Transform Vue SFCs into custom elements.
  15. * **requires Vue \>= 3.2.0 & Vite \>= 2.4.4**
  16. * - `true`: all `*.vue` imports are converted into custom elements
  17. * - `string | RegExp`: matched files are converted into custom elements
  18. *
  19. * @default /\.ce\.vue$/
  20. */
  21. customElement?: boolean | string | RegExp | (string | RegExp)[];
  22. /**
  23. * Enable Vue ref transform (experimental).
  24. * **requires Vue \>= 3.2.5**
  25. * - `true`: transform will be enabled for all vue,js(x),ts(x) files
  26. * - `string | RegExp`: apply to vue + only matched files
  27. * - `false`: disable in all cases
  28. *
  29. * @default false
  30. */
  31. refTransform?: boolean | string | RegExp | (string | RegExp)[];
  32. /**
  33. * @deprecated the plugin now auto-detects whether it's being invoked for ssr.
  34. */
  35. ssr?: boolean;
  36. }
  37. export declare function parseVueRequest(id: string): {
  38. filename: string;
  39. query: VueQuery;
  40. };
  41. export declare interface ResolvedOptions extends Options {
  42. root: string;
  43. devServer?: ViteDevServer;
  44. }
  45. declare function vuePlugin(rawOptions?: Options): Plugin_2;
  46. export default vuePlugin;
  47. export declare interface VueQuery {
  48. vue?: boolean;
  49. src?: boolean;
  50. type?: 'script' | 'template' | 'style' | 'custom';
  51. index?: number;
  52. lang?: string;
  53. raw?: boolean;
  54. }
  55. export { }