KC's Workspace
    Preparing search index...
    interface DepOptimizationConfig {
        disabled?: boolean | "dev" | "build";
        esbuildOptions?: Omit<
            BuildOptions,
            | "watch"
            | "external"
            | "metafile"
            | "bundle"
            | "entryPoints"
            | "write"
            | "outdir"
            | "outfile"
            | "outbase"
            | "outExtension",
        >;
        exclude?: string[];
        extensions?: string[];
        holdUntilCrawlEnd?: boolean;
        ignoreOutdatedRequests?: boolean;
        include?: string[];
        needsInterop?: string[];
        noDiscovery?: boolean;
    }
    Index

    Properties

    disabled?: boolean | "dev" | "build"

    Deps optimization during build was removed in Vite 5.1. This option is now redundant and will be removed in a future version. Switch to using optimizeDeps.noDiscovery and an empty or undefined optimizeDeps.include. true or 'dev' disables the optimizer, false or 'build' leaves it enabled.

    'build'
    
    esbuildOptions?: Omit<
        BuildOptions,
        | "watch"
        | "external"
        | "metafile"
        | "bundle"
        | "entryPoints"
        | "write"
        | "outdir"
        | "outfile"
        | "outbase"
        | "outExtension",
    >

    Options to pass to esbuild during the dep scanning and optimization

    Certain options are omitted since changing them would not be compatible with Vite's dep optimization.

    • external is also omitted, use Vite's optimizeDeps.exclude option
    • plugins are merged with Vite's dep plugin

    https://esbuild.github.io/api

    exclude?: string[]

    Do not optimize these dependencies (must be resolvable import paths, cannot be globs).

    extensions?: string[]

    List of file extensions that can be optimized. A corresponding esbuild plugin must exist to handle the specific extension.

    By default, Vite can optimize .mjs, .js, .ts, and .mts files. This option allows specifying additional extensions.

    holdUntilCrawlEnd?: boolean

    When enabled, it will hold the first optimized deps results until all static imports are crawled on cold start. This avoids the need for full-page reloads when new dependencies are discovered and they trigger the generation of new common chunks. If all dependencies are found by the scanner plus the explicitly defined ones in include, it is better to disable this option to let the browser process more requests in parallel.

    true
    @experimental
    ignoreOutdatedRequests?: boolean

    When enabled, Vite will not throw an error when an outdated optimized dependency is requested. Enabling this option may cause a single module to have a multiple reference.

    false
    @experimental
    include?: string[]

    Force optimize listed dependencies (must be resolvable import paths, cannot be globs).

    needsInterop?: string[]

    Forces ESM interop when importing these dependencies. Some legacy packages advertise themselves as ESM but use require internally

    noDiscovery?: boolean

    Automatic dependency discovery. When noDiscovery is true, only dependencies listed in include will be optimized. The scanner isn't run for cold start in this case. CJS-only dependencies must be present in include during dev.

    false