index.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * https://github.com/vuejs/vue-next/tree/master/packages/ref-transform
  25. *
  26. * **requires Vue \>= 3.2.5**
  27. *
  28. * - `true`: transform will be enabled for all vue,js(x),ts(x) files except
  29. * those inside node_modules
  30. * - `string | RegExp`: apply to vue + only matched files (will include
  31. * node_modules, so specify directories in necessary)
  32. * - `false`: disable in all cases
  33. *
  34. * @default false
  35. */
  36. refTransform?: boolean | string | RegExp | (string | RegExp)[];
  37. /**
  38. * @deprecated the plugin now auto-detects whether it's being invoked for ssr.
  39. */
  40. ssr?: boolean;
  41. }
  42. export declare function parseVueRequest(id: string): {
  43. filename: string;
  44. query: VueQuery;
  45. };
  46. export declare interface ResolvedOptions extends Options {
  47. root: string;
  48. sourceMap: boolean;
  49. devServer?: ViteDevServer;
  50. }
  51. declare function vuePlugin(rawOptions?: Options): Plugin_2;
  52. export default vuePlugin;
  53. export declare interface VueQuery {
  54. vue?: boolean;
  55. src?: boolean;
  56. type?: 'script' | 'template' | 'style' | 'custom';
  57. index?: number;
  58. lang?: string;
  59. raw?: boolean;
  60. }
  61. export { }