KC's Workspace
    Preparing search index...
    interface InlineConfig {
        appType?: AppType;
        assetsInclude?: string | RegExp | (string | RegExp)[];
        base?: string;
        build?: BuildEnvironmentOptions;
        builder?: BuilderOptions;
        cacheDir?: string;
        clearScreen?: boolean;
        configFile?: string | false;
        configLoader?: "runner" | "bundle" | "native";
        css?: CSSOptions;
        customLogger?: Logger;
        define?: Record<string, any>;
        dev?: DevEnvironmentOptions;
        envDir?: string | false;
        envFile?: false;
        environments?: Record<string, EnvironmentOptions>;
        envPrefix?: string | string[];
        esbuild?: false | ESBuildOptions;
        experimental?: ExperimentalOptions;
        forceOptimizeDeps?: boolean;
        future?: FutureOptions | "warn";
        html?: HTMLOptions;
        json?: JsonOptions;
        legacy?: LegacyOptions;
        logLevel?: LogLevel;
        mode?: string;
        optimizeDeps?: DepOptimizationOptions;
        plugins?: PluginOption[];
        preview?: PreviewOptions;
        publicDir?: string | false;
        resolve?: AllResolveOptions;
        root?: string;
        server?: ServerOptions$1;
        ssr?: SSROptions;
        test?: InlineConfig;
        worker?: {
            format?: "es" | "iife";
            plugins?: () => PluginOption[];
            rollupOptions?: Omit<
                RollupOptions,
                "plugins"
                | "input"
                | "onwarn"
                | "preserveEntrySignatures",
            >;
        };
    }

    Hierarchy

    • UserConfig
      • InlineConfig
    Index

    Properties

    appType?: AppType

    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?: string | RegExp | (string | RegExp)[]

    Specify additional picomatch patterns to be treated as static assets.

    base?: string

    Base public path when served in development or production.

    '/'
    

    Build specific options

    builder?: BuilderOptions

    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
    
    configFile?: string | false
    configLoader?: "runner" | "bundle" | "native"

    CSS related options (preprocessors and CSS modules)

    customLogger?: Logger

    Custom logger.

    define?: Record<string, any>

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

    Dev specific options

    envDir?: string | false

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

    root
    
    envFile?: false
    environments?: Record<string, EnvironmentOptions>

    Environment overrides

    envPrefix?: string | string[]

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

    'VITE_'
    
    esbuild?: false | ESBuildOptions

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

    experimental?: ExperimentalOptions

    Experimental features

    Features under this field could change in the future and might NOT follow semver. Please be careful and always pin Vite's version when using them.

    forceOptimizeDeps?: boolean
    future?: FutureOptions | "warn"

    Options to opt-in to future behavior

    HTML related options

    JSON loading options

    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.

    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.

    optimizeDeps?: DepOptimizationOptions

    Dep optimization options

    plugins?: PluginOption[]

    Array of vite plugins to use.

    preview?: PreviewOptions

    Preview specific options, e.g. host, port, https...

    publicDir?: string | false

    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'
    
    root?: string

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

    process.cwd()
    

    Server specific options, e.g. host, port, https...

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

    Options for Vitest

    worker?: {
        format?: "es" | "iife";
        plugins?: () => PluginOption[];
        rollupOptions?: Omit<
            RollupOptions,
            "plugins"
            | "input"
            | "onwarn"
            | "preserveEntrySignatures",
        >;
    }

    Worker bundle options

    Type Declaration

    • Optionalformat?: "es" | "iife"

      Output format for worker bundle

      'iife'
      
    • Optionalplugins?: () => PluginOption[]

      Vite plugins that apply to worker bundle. The plugins returned by this function should be new instances every time it is called, because they are used for each rollup worker bundling process.

    • OptionalrollupOptions?: Omit<RollupOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">

      Rollup options to build worker bundle