Skip to content

Commit 73138aa

Browse files
committed
fix: process.exit in writeBundle hook
1 parent d8ffed0 commit 73138aa

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (options =
6868
compiler = await createCompiler(validated.config)
6969
buildQueue = new BuildQueue(compiler)
7070
},
71-
async buildEnd() {
72-
// ensure the process exits when the build is finished
73-
process.exit(0)
71+
async writeBundle() {
72+
// Clean up compiler resources after files are written
73+
await compiler?.destroy()
74+
compiler = undefined
75+
buildQueue = undefined
7476
},
7577
/**
7678
* `transformInclude` is called for every file that is being transformed.

0 commit comments

Comments
 (0)