Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Aug 7, 2024
1 parent d65c2bb commit e2eff03
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class JsCompilation {
rebuildModule(moduleIdentifiers: Array<string>, f: (...args: any[]) => any): void
importModule(request: string, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
get entries(): JsEntries
finalize(): void
dispose(): void
}

export class JsEntries {
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_binding_values/src/compilation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ impl JsCompilation {
}

#[napi]
pub fn finalize(&self, env: Env) {
pub fn dispose(&self, env: Env) {
// TODO: use napi_add_finalizer if N-API version >= 5
let compilation_id = self.0.id();

Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/etc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ export class Compilation {
// @internal
__internal__setAssetSource(filename: string, source: Source): void;
// @internal
__internal_finalize(): void;
__internal_dispose(): void;
// @internal
__internal_getInner(): binding.JsCompilation;
get assets(): Record<string, Source>;
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/Compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,8 +1138,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
*
* @internal
*/
__internal_finalize() {
return this.#inner.finalize();
__internal_dispose() {
return this.#inner.dispose();
}

seal() {}
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/Compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ class Compiler {
this.#compilation!.startTime = startTime;
this.#compilation!.endTime = Date.now();
this.hooks.afterCompile.callAsync(this.#compilation!, err => {
this.#compilation!.__internal_finalize();
this.#compilation!.__internal_dispose();
if (err) {
return callback(err);
}
Expand Down

0 comments on commit e2eff03

Please sign in to comment.