diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index c8e58142..ed728390 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -6,7 +6,7 @@ import { normalizePath, type BuildOptions, type Rollup, - type UserConfig as ViteUserConfig + type InlineConfig as ViteInlineConfig } from 'vite' import { APP_PATH } from '../alias' import type { SiteConfig } from '../config' @@ -50,7 +50,9 @@ export async function bundle( // resolve options to pass to vite const { rollupOptions } = options - const resolveViteConfig = async (ssr: boolean): Promise => ({ + const resolveViteConfig = async ( + ssr: boolean + ): Promise => ({ root: config.srcDir, cacheDir: config.cacheDir, base: config.site.base, @@ -136,7 +138,8 @@ export async function bundle( }) } } - } + }, + configFile: config.vite?.configFile }) let clientResult!: Rollup.RollupOutput | null diff --git a/src/node/server.ts b/src/node/server.ts index ebf0aedf..42ebbc9c 100644 --- a/src/node/server.ts +++ b/src/node/server.ts @@ -23,6 +23,7 @@ export async function createServer( cacheDir: config.cacheDir, plugins: await createVitePressPlugin(config, false, {}, {}, recreateServer), server: serverOptions, - customLogger: config.logger + customLogger: config.logger, + configFile: config.vite?.configFile }) } diff --git a/src/node/siteConfig.ts b/src/node/siteConfig.ts index 402fb608..4607e710 100644 --- a/src/node/siteConfig.ts +++ b/src/node/siteConfig.ts @@ -83,7 +83,7 @@ export interface UserConfig /** * Vite config */ - vite?: ViteConfig + vite?: ViteConfig & { configFile?: string | false } /** * Configure the scroll offset when the theme has a sticky header.