Skip to content

RollupPluginContext

This content is not available in your language yet.

Defined in: core/index.ts:3285

addWatchFile(id): void

Defined in: core/index.ts:3291

Register an additional file to watch in watch mode. Currently a no-op (graph mutation not supported).

string

void


emitFile(file): string

Defined in: core/index.ts:3310

Emit an additional asset (Rollup this.emitFile 호환, #1880 PR5/6). async build() 의 resolveId/load/transform hook 에서 { type: 'asset', fileName | name, source } 를 emit → reference id 반환, 해당 asset 은 result.outputFiles 에 나타난다. fileName 은 그대로, name 은 source hash 로 파일명 자동 생성(file/copy loader 와 동일 assetNames 패턴). vitePlugin() 어댑터의 resolveId/load/transform hook 에서도 동작(#1880 PR7). { type: 'chunk', id } 는 id(이미 graph 에 있는 모듈)를 별도 chunk 로 분리(#1880 PR7-2b-i, splitting:true). 신규 모듈 chunk emit 은 미지원(build 진단). 그 외 hook / buildSync 는 throw. 반드시 hook 본문에서 동기적으로 호출해야 한다 — await 이후나 detached promise 에서 호출하면 EmitStore 수명을 벗어나 asset 이 누락되거나 정의되지 않은 동작이 된다 (follow-up).

unknown

string


error(error): never

Defined in: core/index.ts:3287

Throw an error from within the plugin. Rollup this.error-compatible.

unknown

never


getFileName(referenceId): string

Defined in: core/index.ts:3314

Resolve an emitted file’s final output name (Rollup this.getFileName 호환, #1880 PR6). this.emitFile 이 돌려준 reference id → 최종 출력 파일명. asset hash 는 source 기반이라 emit 시점에 확정되므로 같은(또는 먼저 완료된) hook 에서 즉시 조회 가능. 미등록 id 는 throw.

string

string


getModuleInfo(id): ManualChunksModuleInfo | null

Defined in: core/index.ts:3317

모듈 그래프 정보(+plugin meta) 조회 (Rollup this.getModuleInfo 호환). async build() 의 transform hook 에서만 사용 가능 (#1880 PR3). 그 외 hook/buildSync 에선 throw.

string

ManualChunksModuleInfo | null


resolve(source, importer?, options?): Promise<{ external?: boolean; id: string; } | null>

Defined in: core/index.ts:3296

Module resolve (Rollup this.resolve 호환, #1880 PR4). async build() 의 resolveId/load/transform hook 에서 native resolver(순수 path resolution)로 해석 → { id, external } 또는 null(미해결). options(skipSelf 등)는 현재 no-op (native resolver 가 plugin 을 재진입하지 않아 skipSelf 자명 충족). 그 외 hook / buildSync / vitePlugin() 어댑터에서는 throw.

string

string | null

unknown

Promise<{ external?: boolean; id: string; } | null>


warn(message): void

Defined in: core/index.ts:3289

Print a warning to the console. Rollup this.warn-compatible — does not stop the build.

unknown

void