Skip to content

Commit

Permalink
chore: optimize the initialization of instance (#2432)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarthusLorin authored Mar 22, 2023
1 parent 34d89ce commit 62bad72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-moose-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rspack/core": patch
---

optimize the initialization of instance
3 changes: 1 addition & 2 deletions packages/rspack/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 62bad72

Please sign in to comment.