KC's Workspace
    Preparing search index...

    Make all properties in T readonly

    interface ResolvedConfig {
        appType: "custom" | "spa" | "mpa";
        assetsInclude: (file: string) => boolean;
        base: string;
        build: ResolvedBuildOptions;
        builder: BuilderOptions & Required<BuilderOptions> | undefined;
        cacheDir: string;
        clearScreen?: boolean;
        command: "build" | "serve";
        configFile: string | undefined;
        configFileDependencies: string[];
        createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
        css: ResolvedCSSOptions;
        customLogger?: Logger;
        define?: Record<string, any>;
        dev: ResolvedDevEnvironmentOptions;
        env: Record<string, any>;
        envDir: string | false;
        environments: Record<string, ResolvedEnvironmentOptions>;
        envPrefix?: string | string[];
        esbuild: (false | ESBuildOptions | undefined) & (false | ESBuildOptions);
        experimental: RequiredExceptFor<ExperimentalOptions, "renderBuiltUrl">;
        future: FutureOptions | undefined;
        getSortedPluginHooks: <K$1 extends keyof Plugin<any>>(
            hookName: K$1,
        ) => NonNullable<HookHandler<Plugin<any>[K$1]>>[];
        getSortedPlugins: <K$1 extends keyof Plugin<any>>(
            hookName: K$1,
        ) => PluginWithRequiredHook<K$1>[];
        html?: HTMLOptions;
        inlineConfig: InlineConfig;
        isProduction: boolean;
        isWorker: boolean;
        json: Required<JsonOptions>;
        legacy?: LegacyOptions;
        logger: Logger;
        logLevel?: LogLevel;
        mode: string;
        optimizeDeps: DepOptimizationOptions;
        plugins: readonly Plugin<any>[];
        preview: ResolvedPreviewOptions;
        publicDir: string;
        resolve: ResolveOptions & { alias?: AliasOptions } & Required<
            ResolveOptions,
        > & { alias: Alias[] };
        root: string;
        server: ResolvedServerOptions;
        ssr: SSROptions & ResolvedSSROptions;
        test?: InlineConfig;
        webSocketToken: string;
        worker: ResolvedWorkerOptions;
    }

    Hierarchy (View Summary)

    Index

    Properties

    appType: "custom" | "spa" | "mpa"

    Whether your application is a Single Page Application (SPA), a Multi-Page Application (MPA), or Custom Application (SSR and frameworks with custom HTML handling)

    'spa'
    
    assetsInclude: (file: string) => boolean
    base: string

    Base public path when served in development or production.

    '/'
    
    builder: BuilderOptions & Required<BuilderOptions> | undefined

    Builder specific options

    cacheDir: string

    Directory to save cache files. Files in this directory are pre-bundled deps or some other cache files that generated by vite, which can improve the performance. You can use --force flag or manually delete the directory to regenerate the cache files. The value can be either an absolute file system path or a path relative to project root. Default to .vite when no package.json is detected.

    'node_modules/.vite'
    
    clearScreen?: boolean
    true
    
    command: "build" | "serve"
    configFile: string | undefined
    configFileDependencies: string[]
    createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn

    Create an internal resolver to be used in special scenarios, e.g. optimizer & handling css @imports.

    This API is deprecated. It only works for the client and ssr environments. The aliasOnly option is also not being used anymore. Plugins should move to createIdResolver(environment.config) instead.

    Use createIdResolver from vite instead.

    customLogger?: Logger

    Custom logger.

    define?: Record<string, any>

    Define global variable replacements. Entries will be defined on window during dev and replaced during build.

    env: Record<string, any>
    envDir: string | false

    Environment files directory. Can be an absolute path, or a path relative from root.

    root
    
    environments: Record<string, ResolvedEnvironmentOptions>
    envPrefix?: string | string[]

    Env variables starts with envPrefix will be exposed to your client source code via import.meta.env.

    'VITE_'
    
    esbuild: (false | ESBuildOptions | undefined) & (false | ESBuildOptions)

    Transform options to pass to esbuild. Or set to false to disable esbuild.

    experimental: RequiredExceptFor<ExperimentalOptions, "renderBuiltUrl">
    future: FutureOptions | undefined
    getSortedPluginHooks: <K$1 extends keyof Plugin<any>>(
        hookName: K$1,
    ) => NonNullable<HookHandler<Plugin<any>[K$1]>>[]
    getSortedPlugins: <K$1 extends keyof Plugin<any>>(
        hookName: K$1,
    ) => PluginWithRequiredHook<K$1>[]

    HTML related options

    inlineConfig: InlineConfig
    isProduction: boolean
    isWorker: boolean
    legacy?: LegacyOptions

    Legacy options

    Features under this field only follow semver for patches, they could be removed in a future minor version. Please always pin Vite's version to a minor when using them.

    logger: Logger
    logLevel?: LogLevel

    Log level.

    'info'
    
    mode: string

    Explicitly set a mode to run in. This will override the default mode for each command, and can be overridden by the command line --mode option.

    plugins: readonly Plugin<any>[]
    publicDir: string

    Directory to serve as plain static assets. Files in this directory are served and copied to build dist dir as-is without transform. The value can be either an absolute file system path or a path relative to project root.

    Set to false or an empty string to disable copied static assets to build dist dir.

    'public'
    
    resolve: ResolveOptions & { alias?: AliasOptions } & Required<ResolveOptions> & {
        alias: Alias[];
    }
    root: string

    Project root directory. Can be an absolute path, or a path relative from the location of the config file itself.

    process.cwd()
    

    SSR specific options We could make SSROptions be a EnvironmentOptions if we can abstract external/noExternal for environments in general.

    Options for Vitest

    webSocketToken: string

    The token to connect to the WebSocket server from browsers.

    We recommend using import.meta.hot rather than connecting to the WebSocket server directly. If you have a usecase that requires connecting to the WebSocket server, please create an issue so that we can discuss.