diff --git a/packages/schema/build.config.ts b/packages/schema/build.config.ts index dfc24f59f1..8a04430474 100644 --- a/packages/schema/build.config.ts +++ b/packages/schema/build.config.ts @@ -29,6 +29,7 @@ export default defineBuildConfig({ 'webpack-bundle-analyzer', 'rollup-plugin-visualizer', 'vite', + '@vitejs/plugin-vue', 'mini-css-extract-plugin', 'terser-webpack-plugin', 'css-minimizer-webpack-plugin', diff --git a/packages/schema/src/config/vite.ts b/packages/schema/src/config/vite.ts index 232197f4ba..2c16b49d37 100644 --- a/packages/schema/src/config/vite.ts +++ b/packages/schema/src/config/vite.ts @@ -8,7 +8,7 @@ export default { * See https://vitejs.dev/config for more information. * Please note that not all vite options are supported in Nuxt. * - * @type {typeof import('vite').UserConfig} + * @type {typeof import('../src/types/config').ViteConfig} * @version 3 */ vite: { diff --git a/packages/schema/src/types/config.ts b/packages/schema/src/types/config.ts index dea1f696a5..e21dfdaecc 100644 --- a/packages/schema/src/types/config.ts +++ b/packages/schema/src/types/config.ts @@ -1,5 +1,7 @@ import { ConfigSchema } from '../../schema/config' import type { ResolvedConfig } from 'c12' +import { UserConfig } from 'vite' +import { Options as VuePluginOptions } from '@vitejs/plugin-vue' type DeepPartial = T extends Function ? T : T extends Record ? { [P in keyof T]?: DeepPartial } : T @@ -25,3 +27,11 @@ export interface PrivateRuntimeConfig extends RuntimeConfigNamespace { } export interface RuntimeConfig extends PrivateRuntimeConfig, RuntimeConfigNamespace { public: PublicRuntimeConfig } + +export interface ViteConfig extends UserConfig { + /** + * Options passed to @vitejs/plugin-vue + * @see https://github.com/vitejs/vite/tree/main/packages/plugin-vue + */ + vue?: VuePluginOptions +}