Home / Class/ ScanEnvironment Class — vite Architecture

ScanEnvironment Class — vite Architecture

Architecture documentation for the ScanEnvironment class in scan.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  aba3fdee_817a_43e8_0481_2e4ff445f775["ScanEnvironment"]
  6c7a7f5e_5d30_3576_49bf_9041362fd3fd["scan.ts"]
  aba3fdee_817a_43e8_0481_2e4ff445f775 -->|defined in| 6c7a7f5e_5d30_3576_49bf_9041362fd3fd
  a85be14c_f2f5_f5e8_54fc_94b79f95354a["pluginContainer()"]
  aba3fdee_817a_43e8_0481_2e4ff445f775 -->|method| a85be14c_f2f5_f5e8_54fc_94b79f95354a
  268da476_7ba7_ec7c_671e_629dab82821a["init()"]
  aba3fdee_817a_43e8_0481_2e4ff445f775 -->|method| 268da476_7ba7_ec7c_671e_629dab82821a

Relationship Graph

Source Code

packages/vite/src/node/optimizer/scan.ts lines 40–67

export class ScanEnvironment extends BaseEnvironment {
  mode = 'scan' as const

  get pluginContainer(): EnvironmentPluginContainer {
    if (!this._pluginContainer)
      throw new Error(
        `${this.name} environment.pluginContainer called before initialized`,
      )
    return this._pluginContainer
  }
  /**
   * @internal
   */
  _pluginContainer: EnvironmentPluginContainer | undefined

  async init(): Promise<void> {
    if (this._initiated) {
      return
    }
    this._initiated = true
    this._pluginContainer = await createEnvironmentPluginContainer(
      this,
      this.plugins,
      undefined,
      false,
    )
  }
}

Frequently Asked Questions

What is the ScanEnvironment class?
ScanEnvironment is a class in the vite codebase, defined in packages/vite/src/node/optimizer/scan.ts.
Where is ScanEnvironment defined?
ScanEnvironment is defined in packages/vite/src/node/optimizer/scan.ts at line 40.

Analyze Your Own Codebase

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

Try Supermodel Free