diff --git a/.changeset/beige-moose-destroy.md b/.changeset/beige-moose-destroy.md new file mode 100644 index 000000000000..f51d4753a3ab --- /dev/null +++ b/.changeset/beige-moose-destroy.md @@ -0,0 +1,5 @@ +--- +"@rspack/core": patch +--- + +optimize the initialization of instance diff --git a/packages/rspack/src/compiler.ts b/packages/rspack/src/compiler.ts index 39ef23701068..a3dbadcdcdd1 100644 --- a/packages/rspack/src/compiler.ts +++ b/packages/rspack/src/compiler.ts @@ -139,11 +139,10 @@ class Compiler { * Lazy initialize instance so it could access the changed options */ get #instance() { - const options = getRawOptions(this.options, this); this.#_instance = this.#_instance ?? new binding.Rspack( - options, + getRawOptions(this.options, this), { make: this.#make.bind(this), emit: this.#emit.bind(this),