vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
40 lines (39 loc) • 1.59 kB
TypeScript
export { commonConfig };
export { getVikeConfigPublic };
export { getVikeConfigInternal };
export type { VikeConfigPublic };
import { type InlineConfig, type Plugin, type ResolvedConfig, type UserConfig } from 'vite';
import { type VikeConfigObject } from './importUserCode/v1-design/getVikeConfig.js';
import type { PrerenderContextPublic } from '../../prerender/runPrerender.js';
import type { VitePluginServerEntryOptions } from '@brillout/vite-plugin-server-entry/plugin';
declare module 'vite' {
interface UserConfig {
_isDev?: boolean;
_vikeVitePluginOptions?: unknown;
vitePluginServerEntry?: VitePluginServerEntryOptions;
_root?: string;
_baseViteOriginal?: string;
_viteConfigFromUserEnhanced?: InlineConfig;
_vike?: VikeConfigPublic;
_vikeConfigObject?: VikeConfigObject;
}
}
type VikeConfigPublic = {
config: VikeConfigObject['global']['config'];
pages: VikeConfigObject['pages'];
prerenderContext: PrerenderContext;
};
type PrerenderContext = {
isPrerenderingEnabled: boolean;
isPrerenderingEnabledForAllPages: boolean;
} & ({
[K in keyof PrerenderContextPublic]: null;
} | PrerenderContextPublic);
declare function commonConfig(vikeVitePluginOptions: unknown): Plugin[];
/**
* Get all the information Vike knows about the app in your Vite plugin.
*
* https://vike.dev/getVikeConfig
*/
declare function getVikeConfigInternal(config: ResolvedConfig | UserConfig): VikeConfigPublic;
declare function getVikeConfigPublic(config: ResolvedConfig | UserConfig): VikeConfigPublic;