Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
fix: dev-pack may cause memory leak (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxxyx authored Mar 21, 2023
1 parent dc6e8c4 commit 63ed55c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .changeset/old-apes-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@midwayjs/dev-pack': patch
'@midwayjs/bundler': patch
'@midwayjs/esrun': patch
'@midwayjs/hcc': patch
'@midwayjs/hooks': patch
'@midwayjs/hooks-bundler': patch
'@midwayjs/hooks-core': patch
'@midwayjs/hooks-internal': patch
'@midwayjs/hooks-kit': patch
'@midwayjs/hooks-upload': patch
'@midwayjs/rpc': patch
'@midwayjs/serve': patch
'@midwayjs/test-util': patch
---

fix: dev-pack may cause memory leak
4 changes: 2 additions & 2 deletions packages/dev-pack/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ export class DevServer {
ignored: /(^|[\/\\])\../,
persistent: true,
ignoreInitial: true,
cwd: this.options.cwd,
cwd: resolve(this.options.cwd, this.options.sourceDir),
})

;['midway.config.ts', 'midway.config.js', 'f.yml']
.map((file) => resolve(this.options.sourceDir, file))
.map((file) => resolve(this.options.cwd, file))
.filter((file) => existsSync(file))
.forEach((file) => watcher.add(file))

Expand Down

0 comments on commit 63ed55c

Please sign in to comment.