Home / Type/ ResolvePluginOptions Type — vite Architecture

ResolvePluginOptions Type — vite Architecture

Architecture documentation for the ResolvePluginOptions type/interface in resolve.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  bd84d089_61b0_c7a2_bc8c_0a6bdbf7974c["ResolvePluginOptions"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3["resolve.ts"]
  bd84d089_61b0_c7a2_bc8c_0a6bdbf7974c -->|defined in| dcff87b0_a8ea_57a2_3b29_a7b8f19986f3
  style bd84d089_61b0_c7a2_bc8c_0a6bdbf7974c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/resolve.ts lines 121–173

interface ResolvePluginOptions {
  root: string
  isBuild: boolean
  isProduction: boolean
  packageCache?: PackageCache
  /**
   * src code mode also attempts the following:
   * - resolving /xxx as URLs
   * - resolving bare imports from optimized deps
   */
  asSrc?: boolean
  tryIndex?: boolean
  tryPrefix?: string
  preferRelative?: boolean
  isRequire?: boolean
  // True when resolving during the scan phase to discover dependencies
  scan?: boolean
  /**
   * @internal
   */
  skipMainField?: boolean

  /**
   * Optimize deps during dev, defaults to false // TODO: Review default
   * @internal
   */
  optimizeDeps?: boolean

  /**
   * Externalize using `resolve.external` and `resolve.noExternal` when running a build in
   * a server environment. Defaults to false (only for createResolver)
   * @internal
   */
  externalize?: boolean

  /**
   * Set by createResolver, we only care about the resolved id. moduleSideEffects
   * and other fields are discarded so we can avoid computing them.
   * @internal
   */
  idOnly?: boolean

  /**
   * Set by `nodeResolveWithVite`, disables optional peer dependency handling.
   * @internal
   */
  disableOptionalPeerDepHandling?: boolean

  /**
   * Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
   */
  legacyInconsistentCjsInterop?: boolean
}

Frequently Asked Questions

What is the ResolvePluginOptions type?
ResolvePluginOptions is a type/interface in the vite codebase, defined in packages/vite/src/node/plugins/resolve.ts.
Where is ResolvePluginOptions defined?
ResolvePluginOptions is defined in packages/vite/src/node/plugins/resolve.ts at line 121.

Analyze Your Own Codebase

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

Try Supermodel Free