index.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import type * as _compiler from 'vue/compiler-sfc';
  2. import type { Plugin as Plugin_2 } from 'vite';
  3. import type { SFCScriptCompileOptions } from 'vue/compiler-sfc';
  4. import type { SFCStyleCompileOptions } from 'vue/compiler-sfc';
  5. import type { SFCTemplateCompileOptions } from 'vue/compiler-sfc';
  6. import type { ViteDevServer } from 'vite';
  7. export declare interface Options {
  8. include?: string | RegExp | (string | RegExp)[];
  9. exclude?: string | RegExp | (string | RegExp)[];
  10. isProduction?: boolean;
  11. script?: Partial<SFCScriptCompileOptions>;
  12. template?: Partial<SFCTemplateCompileOptions>;
  13. style?: Partial<SFCStyleCompileOptions>;
  14. /**
  15. * Transform Vue SFCs into custom elements.
  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 reactivity transform (experimental).
  24. * https://github.com/vuejs/core/tree/master/packages/reactivity-transform
  25. * - `true`: transform will be enabled for all vue,js(x),ts(x) files except
  26. * those inside node_modules
  27. * - `string | RegExp`: apply to vue + only matched files (will include
  28. * node_modules, so specify directories in necessary)
  29. * - `false`: disable in all cases
  30. *
  31. * @default false
  32. */
  33. reactivityTransform?: boolean | string | RegExp | (string | RegExp)[];
  34. /**
  35. * Use custom compiler-sfc instance. Can be used to force a specific version.
  36. */
  37. compiler?: typeof _compiler;
  38. }
  39. export declare function parseVueRequest(id: string): {
  40. filename: string;
  41. query: VueQuery;
  42. };
  43. export declare interface ResolvedOptions extends Options {
  44. compiler: typeof _compiler;
  45. root: string;
  46. sourceMap: boolean;
  47. cssDevSourcemap: boolean;
  48. devServer?: ViteDevServer;
  49. devToolsEnabled?: boolean;
  50. }
  51. declare function vuePlugin(rawOptions?: Options): Plugin_2;
  52. export default vuePlugin;
  53. export declare interface VueQuery {
  54. vue?: boolean;
  55. src?: string;
  56. type?: 'script' | 'template' | 'style' | 'custom';
  57. index?: number;
  58. lang?: string;
  59. raw?: boolean;
  60. }
  61. export { }