Home / Function/ close() — vite Function Reference

close() — vite Function Reference

Architecture documentation for the close() function in pluginContainer.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  562e9e2b_e379_c47c_c40f_7b7850f80d38["close()"]
  285b1044_dd20_6f59_7cf5_0ad094eeacee["EnvironmentPluginContainer"]
  562e9e2b_e379_c47c_c40f_7b7850f80d38 -->|defined in| 285b1044_dd20_6f59_7cf5_0ad094eeacee
  969cb910_e45f_4b10_e707_9ec8d9fcc8d8["close()"]
  969cb910_e45f_4b10_e707_9ec8d9fcc8d8 -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  158d0e42_28ce_8bd3_13df_1f08b6dbf23f["stylProcessor()"]
  158d0e42_28ce_8bd3_13df_1f08b6dbf23f -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  1da538be_8fb3_3d85_2856_d9bfecfb04f5["createPreprocessorWorkerController()"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  5c50110b_5c76_c14f_b1dd_3efd3df7f375["preview()"]
  5c50110b_5c76_c14f_b1dd_3efd3df7f375 -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  2a568e89_e3e7_9284_fd00_e1a9ca1ec09a["close()"]
  2a568e89_e3e7_9284_fd00_e1a9ca1ec09a -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  94ad7f99_b02e_152e_c5a9_749d6de8d3c0["buildEnvironment()"]
  94ad7f99_b02e_152e_c5a9_749d6de8d3c0 -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  be3526c9_4f67_b6dd_9a14_dd784ae26c08["hookParallel()"]
  562e9e2b_e379_c47c_c40f_7b7850f80d38 -->|calls| be3526c9_4f67_b6dd_9a14_dd784ae26c08
  5551e407_98e1_a15d_289d_2913c0ed600b["_getPluginContext()"]
  562e9e2b_e379_c47c_c40f_7b7850f80d38 -->|calls| 5551e407_98e1_a15d_289d_2913c0ed600b
  969cb910_e45f_4b10_e707_9ec8d9fcc8d8["close()"]
  562e9e2b_e379_c47c_c40f_7b7850f80d38 -->|calls| 969cb910_e45f_4b10_e707_9ec8d9fcc8d8
  style 562e9e2b_e379_c47c_c40f_7b7850f80d38 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/pluginContainer.ts lines 638–657

  async close(): Promise<void> {
    if (this._closed) return
    this._closed = true
    await Promise.allSettled(Array.from(this._processesing))
    const config = this.environment.getTopLevelConfig()
    await this.hookParallel(
      'buildEnd',
      (plugin) => this._getPluginContext(plugin),
      () => [],
      (plugin) =>
        this.environment.name === 'client' ||
        config.server.perEnvironmentStartEndDuringDev ||
        plugin.perEnvironmentStartEndDuringDev,
    )
    await this.hookParallel(
      'closeBundle',
      (plugin) => this._getPluginContext(plugin),
      () => [],
    )
  }

Domain

Subdomains

Frequently Asked Questions

What does close() do?
close() is a function in the vite codebase, defined in packages/vite/src/node/server/pluginContainer.ts.
Where is close() defined?
close() is defined in packages/vite/src/node/server/pluginContainer.ts at line 638.
What does close() call?
close() calls 3 function(s): _getPluginContext, close, hookParallel.
What calls close()?
close() is called by 6 function(s): buildEnvironment, close, close, createPreprocessorWorkerController, preview, stylProcessor.

Analyze Your Own Codebase

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

Try Supermodel Free