Skip to content

fix: exit on buildEnd#7

Merged
christian-bromann merged 3 commits intostencil-community:mainfrom
davidpett:patch-1
Jun 19, 2025
Merged

fix: exit on buildEnd#7
christian-bromann merged 3 commits intostencil-community:mainfrom
davidpett:patch-1

Conversation

@davidpett
Copy link
Copy Markdown
Contributor

process.exit in buildEnd hook

process.exit in buildEnd hook
@christian-bromann
Copy link
Copy Markdown
Member

process.exit

Are we sure we always want to quit the process when the buildEnd hook is called? What happens if we run the watch command? Alternatively we can shut down all compiler class and remove all event listener we may have open.

@davidpett
Copy link
Copy Markdown
Contributor Author

i'm not familiar with unplugin at all, is there a way to check if watch is running? we could wrap this in a conditional.

@christian-bromann
Copy link
Copy Markdown
Member

There is a playground project that uses the unplugin in a Vite context, which is the same context used with Storybook. We can verify there.

@davidpett
Copy link
Copy Markdown
Contributor Author

watch seems to continue to work

@davidpett
Copy link
Copy Markdown
Contributor Author

@christian-bromann I changed to the closeBundle hook and also added a check for watch mode. this is working for me in both build and watch modes

@christian-bromann
Copy link
Copy Markdown
Member

How would the NODE_ENV environment variable impact the behavior? Aren't there scenarios where we would want to build a project in dev mode without having it being stuck?

Also, did you find any documentation on closeBundle?

@davidpett
Copy link
Copy Markdown
Contributor Author

actually reading now that buildEnd is not called in dev mode, so the initial commit is valid

https://vite.dev/guide/api-plugin#universal-hooks

Copy link
Copy Markdown
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, LGTM 👍

@christian-bromann christian-bromann merged commit 6e1ef2c into stencil-community:main Jun 19, 2025
@davidpett davidpett deleted the patch-1 branch June 19, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants