diff --git a/packages/rspack/etc/core.api.md b/packages/rspack/etc/core.api.md index e1d5b87246e4..2f6544580740 100644 --- a/packages/rspack/etc/core.api.md +++ b/packages/rspack/etc/core.api.md @@ -894,7 +894,6 @@ export class Compiler { cache: Cache_2; // (undocumented) close(callback: (error?: Error | null) => void): void; - // (undocumented) compile(callback: liteTapable.Callback): void; // (undocumented) compilerPath: string; diff --git a/packages/rspack/src/Compiler.ts b/packages/rspack/src/Compiler.ts index 1f1376da9f9b..d3994237538e 100644 --- a/packages/rspack/src/Compiler.ts +++ b/packages/rspack/src/Compiler.ts @@ -656,6 +656,11 @@ class Compiler { return !isRoot; } + /** + * Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on. + * TODO: make this method private in the next major release + * @private this method is only used in Rspack core + */ compile(callback: liteTapable.Callback) { const startTime = Date.now(); const params = this.#newCompilationParams(); diff --git a/website/docs/en/api/javascript-api/compiler.mdx b/website/docs/en/api/javascript-api/compiler.mdx index a738a72d36ee..f6a4bb711375 100644 --- a/website/docs/en/api/javascript-api/compiler.mdx +++ b/website/docs/en/api/javascript-api/compiler.mdx @@ -118,26 +118,6 @@ The Watching object provides the following methods: -### compile - -Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on. - -```ts -compile( - callback: (compilation: Compilation) => void // callback after this compilation -): void -``` - - - - - - - ### close Close the current compiler, and handle low-priority tasks such as caching during this period. diff --git a/website/docs/zh/api/javascript-api/compiler.mdx b/website/docs/zh/api/javascript-api/compiler.mdx index 4495d4b397bc..3743dd9282f9 100644 --- a/website/docs/zh/api/javascript-api/compiler.mdx +++ b/website/docs/zh/api/javascript-api/compiler.mdx @@ -118,26 +118,6 @@ Watching 对象提供如下方法: -### compile - -创建 Compilation 并执行编译流程,是 `compiler.run` 和 `compiler.watch` 依赖的底层方法。 - -```ts -function compile( - callback: (compilation: Compilation) => void, // 编译流程完成后回调 -): void; -``` - - - - - - - ### close 关闭当前构建器,在此期间处理低优先级任务,如缓存等。