Skip to content

Commit e6ef4a9

Browse files
committed
fix: change process.exit to the closeBundle hook
buildEnd happens before all output files are written causing issues with not including things like storybook's iframe.html
1 parent d8ffed0 commit e6ef4a9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ 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
71+
async closeBundle() {
72+
// Use closeBundle instead of buildEnd to ensure all output files
73+
// (including iframe.html in Storybook builds) are written before exiting
7374
process.exit(0)
7475
},
7576
/**

0 commit comments

Comments
 (0)