PluginBuild
Defined in: core/index.ts:1589
Methods
섹션 제목: “Methods”onAstFunction()
섹션 제목: “onAstFunction()”onAstFunction(
options,callback):void
Defined in: core/index.ts:1647
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(info) => HookResult<AstFunctionResult>
Returns
섹션 제목: “Returns”void
onBuildEnd()
섹션 제목: “onBuildEnd()”onBuildEnd(
callback):void
Defined in: core/index.ts:1639
Called once at bundle end. Dispatched for both success and failure. On
failure, the first fatal diagnostic item is wrapped in an Error and
passed (#2156). In watch mode it is called for the initial build and on
every rebuild.
Called before onCloseBundle.
Parameters
섹션 제목: “Parameters”callback
섹션 제목: “callback”(error?) => void | Promise<void>
Returns
섹션 제목: “Returns”void
onBuildStart()
섹션 제목: “onBuildStart()”onBuildStart(
callback):void
Defined in: core/index.ts:1630
Called once at bundle start. Same as esbuild onStart,
Rollup/Vite/rolldown buildStart (#2156). In watch mode it is called for
the initial build and on every rebuild (same as the Rollup 5+ policy).
No arguments — same as esbuild onStart. BuildOptions is already passed
during the plugin’s own setup.
Parameters
섹션 제목: “Parameters”callback
섹션 제목: “callback”() => void | Promise<void>
Returns
섹션 제목: “Returns”void
onCloseBundle()
섹션 제목: “onCloseBundle()”onCloseBundle(
callback):void
Defined in: core/index.ts:1646
Called once after output files are written (#2156). Same as Rollup
closeBundle — used for temp file cleanup, notifying external systems of
build completion, etc. In watch mode it is called for the initial build
and on every rebuild.
Parameters
섹션 제목: “Parameters”callback
섹션 제목: “callback”() => void | Promise<void>
Returns
섹션 제목: “Returns”void
onGenerateBundle()
섹션 제목: “onGenerateBundle()”onGenerateBundle(
callback):void
Defined in: core/index.ts:1621
Parameters
섹션 제목: “Parameters”callback
섹션 제목: “callback”(outputs) => void | Promise<void>
Returns
섹션 제목: “Returns”void
onLoad()
섹션 제목: “onLoad()”onLoad(
options,callback):void
Defined in: core/index.ts:1603
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(args) => HookResult<{ contents: string | Uint8Array<ArrayBufferLike>; loader?: string; map?: unknown; meta?: Record<string, unknown>; }>
Returns
섹션 제목: “Returns”void
onRenderChunk()
섹션 제목: “onRenderChunk()”onRenderChunk(
options,callback):void
Defined in: core/index.ts:1617
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(args) => HookResult<{ code: string; }>
Returns
섹션 제목: “Returns”void
onResolve()
섹션 제목: “onResolve()”onResolve(
options,callback):void
Defined in: core/index.ts:1590
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(args) => HookResult<{ disabled?: boolean; external?: boolean; path?: string; }>
Returns
섹션 제목: “Returns”void
onResolveContext()
섹션 제목: “onResolveContext()”onResolveContext(
options,callback):void
Defined in: core/index.ts:1669
Fills in the match results of require.context(dir, recursive, filter, mode) from the host runtime. (#1579) Since ZNTC has no regex executor of
its own (#1771), this is delegated to the host’s RegExp — Node V8 / Bun
JSC.
options.filter applies to dir (e.g. /^\./app/ to process only a
specific directory).
Callback return:
{ context: string[] }— array of matched file paths (empty array = empty context)null/undefined— try the next plugin (if all are null, the graph emits a require_context_no_handler diagnostic)
The callback argument filter is the regex body of require.context
(without slashes), and flags are the regex flags. The host compiles it
with new RegExp(filter, flags) and then matches.
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(args) => HookResult<{ context: string[]; }>
Returns
섹션 제목: “Returns”void
onTransform()
섹션 제목: “onTransform()”onTransform(
options,callback):void
Defined in: core/index.ts:1613
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”filter
섹션 제목: “filter”RegExp
callback
섹션 제목: “callback”(args) => HookResult<{ code: string; map?: unknown; }>
Returns
섹션 제목: “Returns”void