BasicMinimalPluginContext Class — vite Architecture
Architecture documentation for the BasicMinimalPluginContext class in pluginContainer.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1["BasicMinimalPluginContext"] 3b8df068_35d0_2c94_3ad1_e93c93d1d613["pluginContainer.ts"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|defined in| 3b8df068_35d0_2c94_3ad1_e93c93d1d613 f4685280_4b3c_98dd_8a27_d076e8aa8e44["constructor()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| f4685280_4b3c_98dd_8a27_d076e8aa8e44 2acd4596_a167_f964_fd51_412ec8a3d14e["pluginName()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 2acd4596_a167_f964_fd51_412ec8a3d14e 20f96d74_dcf3_b3aa_4061_fdb53d4e3628["debug()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 20f96d74_dcf3_b3aa_4061_fdb53d4e3628 7e22b0a1_210d_c2ca_9a20_17eec3acb06f["info()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 7e22b0a1_210d_c2ca_9a20_17eec3acb06f 3cf1d94a_16a2_96d6_7d1d_9757e22a2557["warn()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 3cf1d94a_16a2_96d6_7d1d_9757e22a2557 8127cae8_510b_1333_1a76_2d21b503c3a6["error()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 8127cae8_510b_1333_1a76_2d21b503c3a6 8bf1c22d_2b9a_8324_6d8c_7f01c0a9903e["_normalizeRawLog()"] 25e1bd14_1d67_d32d_fef1_fa2f005ed7c1 -->|method| 8bf1c22d_2b9a_8324_6d8c_7f01c0a9903e
Relationship Graph
Source Code
packages/vite/src/node/server/pluginContainer.ts lines 670–715
export class BasicMinimalPluginContext<Meta = PluginContextMeta> {
constructor(
public meta: Meta,
private _logger: Logger,
) {}
// FIXME: properly support this later
// eslint-disable-next-line @typescript-eslint/class-literal-property-style
get pluginName(): string {
return ''
}
debug(rawLog: string | RollupLog | (() => string | RollupLog)): void {
const log = this._normalizeRawLog(rawLog)
const msg = buildErrorMessage(log, [`debug: ${log.message}`], false)
debugPluginContainerContext?.(msg)
}
info(rawLog: string | RollupLog | (() => string | RollupLog)): void {
const log = this._normalizeRawLog(rawLog)
const msg = buildErrorMessage(log, [`info: ${log.message}`], false)
this._logger.info(msg, { clear: true, timestamp: true })
}
warn(rawLog: string | RollupLog | (() => string | RollupLog)): void {
const log = this._normalizeRawLog(rawLog)
const msg = buildErrorMessage(
log,
[colors.yellow(`warning: ${log.message}`)],
false,
)
this._logger.warn(msg, { clear: true, timestamp: true })
}
error(e: string | RollupError): never {
const err = (typeof e === 'string' ? new Error(e) : e) as RollupError
throw err
}
private _normalizeRawLog(
rawLog: string | RollupLog | (() => string | RollupLog),
): RollupLog {
const logValue = typeof rawLog === 'function' ? rawLog() : rawLog
return typeof logValue === 'string' ? new Error(logValue) : logValue
}
}
Domain
Source
Frequently Asked Questions
What is the BasicMinimalPluginContext class?
BasicMinimalPluginContext is a class in the vite codebase, defined in packages/vite/src/node/server/pluginContainer.ts.
Where is BasicMinimalPluginContext defined?
BasicMinimalPluginContext is defined in packages/vite/src/node/server/pluginContainer.ts at line 670.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free