Home / Type/ UserConfig Type — vite Architecture

UserConfig Type — vite Architecture

Architecture documentation for the UserConfig type/interface in config.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  650c6af9_c8d9_b67f_9149_9fa38a8587ab["UserConfig"]
  7da774f9_eca5_d54e_6e01_6bee7d460a2b["config.ts"]
  650c6af9_c8d9_b67f_9149_9fa38a8587ab -->|defined in| 7da774f9_eca5_d54e_6e01_6bee7d460a2b
  style 650c6af9_c8d9_b67f_9149_9fa38a8587ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/config.ts lines 339–522

export interface UserConfig extends DefaultEnvironmentOptions {
  /**
   * Project root directory. Can be an absolute path, or a path relative from
   * the location of the config file itself.
   * @default process.cwd()
   */
  root?: string
  /**
   * Base public path when served in development or production.
   * @default '/'
   */
  base?: 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.
   * @default 'public'
   */
  publicDir?: string | false
  /**
   * 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.
   * @default 'node_modules/.vite'
   */
  cacheDir?: 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.
   */
  mode?: string
  /**
   * Array of vite plugins to use.
   */
  plugins?: PluginOption[]
  /**
   * HTML related options
   */
  html?: HTMLOptions
  /**
   * CSS related options (preprocessors and CSS modules)
   */
  css?: CSSOptions
  /**
   * JSON loading options
   */
  json?: JsonOptions
  /**
   * Transform options to pass to esbuild.
   * Or set to `false` to disable esbuild.
   *
   * @deprecated Use `oxc` option instead.
   */
  esbuild?: ESBuildOptions | false
  /**
   * Transform options to pass to Oxc.
   * Or set to `false` to disable Oxc.
   */
  oxc?: OxcOptions | false
  /**
   * Specify additional picomatch patterns to be treated as static assets.
   */
  assetsInclude?: string | RegExp | (string | RegExp)[]
  /**
   * Builder specific options
   * @experimental
   */
  builder?: BuilderOptions
  /**
   * Server specific options, e.g. host, port, https...
   */
  server?: ServerOptions
  /**
   * Preview specific options, e.g. host, port, https...
   */
  preview?: PreviewOptions

Frequently Asked Questions

What is the UserConfig type?
UserConfig is a type/interface in the vite codebase, defined in packages/vite/src/node/config.ts.
Where is UserConfig defined?
UserConfig is defined in packages/vite/src/node/config.ts at line 339.

Analyze Your Own Codebase

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

Try Supermodel Free