Home / Type/ DepOptimizationConfig Type — vite Architecture

DepOptimizationConfig Type — vite Architecture

Architecture documentation for the DepOptimizationConfig type/interface in index.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  e58f359e_e088_1368_10dc_00e9a8ae8bc3["DepOptimizationConfig"]
  2f328851_91ee_fb05_63f0_4f466b9d6250["index.ts"]
  e58f359e_e088_1368_10dc_00e9a8ae8bc3 -->|defined in| 2f328851_91ee_fb05_63f0_4f466b9d6250
  style e58f359e_e088_1368_10dc_00e9a8ae8bc3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/optimizer/index.ts lines 74–174

export interface DepOptimizationConfig {
  /**
   * Force optimize listed dependencies (must be resolvable import paths,
   * cannot be globs).
   */
  include?: string[]
  /**
   * Do not optimize these dependencies (must be resolvable import paths,
   * cannot be globs).
   */
  exclude?: string[]
  /**
   * Forces ESM interop when importing these dependencies. Some legacy
   * packages advertise themselves as ESM but use `require` internally
   * @experimental
   */
  needsInterop?: string[]
  /**
   * 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
   *
   * @deprecated Use `rolldownOptions` instead.
   */
  esbuildOptions?: DepsOptimizerEsbuildOptions
  /**
   * @deprecated Use `rolldownOptions` instead.
   */
  rollupOptions?: Omit<RolldownOptions, 'input' | 'logLevel' | 'output'> & {
    output?: Omit<
      RolldownOutputOptions,
      'format' | 'sourcemap' | 'dir' | 'banner'
    >
  }
  /**
   * Options to pass to rolldown during the dep scanning and optimization
   *
   * Certain options are omitted since changing them would not be compatible
   * with Vite's dep optimization.
   *
   * - `plugins` are merged with Vite's dep plugin
   */
  rolldownOptions?: Omit<RolldownOptions, 'input' | 'logLevel' | 'output'> & {
    output?: Omit<
      RolldownOutputOptions,
      'format' | 'sourcemap' | 'dir' | 'banner'
    >
  }
  /**
   * 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.
   *
   * @experimental
   */
  extensions?: string[]
  /**
   * 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.
   * @default 'build'
   * @deprecated
   * @experimental
   */
  disabled?: boolean | 'build' | 'dev'
  /**
   * 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.
   * @default false
   */
  noDiscovery?: boolean

Frequently Asked Questions

What is the DepOptimizationConfig type?
DepOptimizationConfig is a type/interface in the vite codebase, defined in packages/vite/src/node/optimizer/index.ts.
Where is DepOptimizationConfig defined?
DepOptimizationConfig is defined in packages/vite/src/node/optimizer/index.ts at line 74.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free