Home / File/ plugin.ts — vite Source File

plugin.ts — vite Source File

Architecture documentation for plugin.ts, a typescript file in the vite codebase. 33 imports, 38 dependents.

File typescript ViteCore ConfigEngine 33 imports 38 dependents 10 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7["plugin.ts"]
  7da774f9_eca5_d54e_6e01_6bee7d460a2b["config.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 7da774f9_eca5_d54e_6e01_6bee7d460a2b
  8fae22c9_82ca_62c0_39af_8389eb2fcb6b["ConfigEnv"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 8fae22c9_82ca_62c0_39af_8389eb2fcb6b
  03d49d45_1bb8_d92d_b6c3_7c5349445526["EnvironmentOptions"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 03d49d45_1bb8_d92d_b6c3_7c5349445526
  eb5604c2_58e1_1c00_5a1a_5d97ea5236ad["ResolvedConfig"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> eb5604c2_58e1_1c00_5a1a_5d97ea5236ad
  fe7f5962_2950_2a13_2dfe_8f14ff3bb0d8["UserConfig"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> fe7f5962_2950_2a13_2dfe_8f14ff3bb0d8
  650c6af9_c8d9_b67f_9149_9fa38a8587ab["UserConfig"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 650c6af9_c8d9_b67f_9149_9fa38a8587ab
  a423a1ed_f7d8_0eb5_9b8f_ddfa7fa8147e["index.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> a423a1ed_f7d8_0eb5_9b8f_ddfa7fa8147e
  ccda21cb_2052_e11b_814e_2af0ea44e96a["ServerHook"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> ccda21cb_2052_e11b_814e_2af0ea44e96a
  45981d85_cbdd_e969_8c88_c17072ea0eda["build.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 45981d85_cbdd_e969_8c88_c17072ea0eda
  438d0822_4ec1_051e_5c1b_59886ac19961["BuildAppHook"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 438d0822_4ec1_051e_5c1b_59886ac19961
  f8fe0737_718a_5509_b722_473f207d5906["html.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> f8fe0737_718a_5509_b722_473f207d5906
  5348a242_f2a4_588e_42f0_1aa4bc1b1e80["IndexHtmlTransform"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> 5348a242_f2a4_588e_42f0_1aa4bc1b1e80
  a3adc511_3c03_7f25_9d76_5d3ed9987eb5["moduleGraph.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> a3adc511_3c03_7f25_9d76_5d3ed9987eb5
  fc3efa20_5545_5daf_3cf9_fa65c8365591["EnvironmentModuleNode"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 --> fc3efa20_5545_5daf_3cf9_fa65c8365591
  style 5abb8c87_ffcb_f2d4_7421_e36705d9e5c7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type {
  CustomPluginOptions,
  ImportKind,
  LoadResult,
  MinimalPluginContext,
  ModuleType,
  ModuleTypeFilter,
  ObjectHook,
  PluginContext,
  PluginContextMeta,
  ResolveIdResult,
  Plugin as RolldownPlugin,
  TransformPluginContext,
  TransformResult,
} from 'rolldown'
import type {
  ConfigEnv,
  EnvironmentOptions,
  ResolvedConfig,
  UserConfig,
} from './config'
import type { ServerHook } from './server'
import type { BuildAppHook } from './build'
import type { IndexHtmlTransform } from './plugins/html'
import type { EnvironmentModuleNode } from './server/moduleGraph'
import type { ModuleNode } from './server/mixedModuleGraph'
import type { HmrContext, HotUpdateOptions } from './server/hmr'
import type { DevEnvironment } from './server/environment'
import type { Environment } from './environment'
import type { PartialEnvironment } from './baseEnvironment'
import type { PreviewServerHook } from './preview'
import { arraify, asyncFlatten } from './utils'
import type { StringFilter } from './plugins/pluginFilter'

/**
 * Vite plugins extends the Rollup plugin interface with a few extra
 * vite-specific options. A valid vite plugin is also a valid Rollup plugin.
 * On the contrary, a Rollup plugin may or may NOT be a valid vite universal
 * plugin, since some Rollup features do not make sense in an unbundled
 * dev server context. That said, as long as a rollup plugin doesn't have strong
 * coupling between its bundle phase and output phase hooks then it should
 * just work (that means, most of them).
 *
 * By default, the plugins are run during both serve and build. When a plugin
 * is applied during serve, it will only run **non output plugin hooks** (see
 * rollup type definition of {@link rollup#PluginHooks}). You can think of the
 * dev server as only running `const bundle = rollup.rollup()` but never calling
 * `bundle.generate()`.
 *
 * A plugin that expects to have different behavior depending on serve/build can
 * export a factory function that receives the command being run via options.
 *
 * If a plugin should be applied only for server or build, a function format
 * config file can be used to conditional determine the plugins to use.
 *
 * The current environment can be accessed from the context for the all non-global
 * hooks (it is not available in config, configResolved, configureServer, etc).
 * It can be a dev, build, or scan environment.
 * Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
 */
// ... (368 more lines)

Domain

Subdomains

Imported By

Frequently Asked Questions

What does plugin.ts do?
plugin.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in plugin.ts?
plugin.ts defines 10 function(s): code, config, ctx, environment, id, name, options, perEnvironmentPlugin, resolveEnvironmentPlugins, source.
What does plugin.ts depend on?
plugin.ts imports 33 module(s): BuildAppHook, ConfigEnv, DevEnvironment, Environment, EnvironmentModuleNode, EnvironmentOptions, HmrContext, HotUpdateOptions, and 25 more.
What files import plugin.ts?
plugin.ts is imported by 38 file(s): asset.ts, assetImportMetaUrl.ts, baseEnvironment.ts, build.ts, clientInjections.ts, config.ts, css.ts, define.ts, and 30 more.
Where is plugin.ts in the architecture?
plugin.ts is located at packages/vite/src/node/plugin.ts (domain: ViteCore, subdomain: ConfigEngine, directory: packages/vite/src/node).

Analyze Your Own Codebase

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

Try Supermodel Free