-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a writeBundle or buildEnd hook #880
Comments
rollup docs for writeBundle start with "If it is called". So it is not mandatory to call it. rollup-plugin-workbox could try to use generatebundle instead. I'm not sure you should fake writebundle unless what vite is writing exactly matches what the hook api expects it too. Otherwise you get lots of compatibility issues |
Closed
underfin
added a commit
to rolldown/vite
that referenced
this issue
Oct 26, 2020
1. generate asset by `emitFile` and format file name by rollup options. 2. use `rollup.write` instead of `rollup.generate`, let many rollup plugins can work with `writeBundle` hook. fix vitejs#880, fix vitejs#912, fix vitejs#378
yyx990803
pushed a commit
that referenced
this issue
Oct 26, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
A good number of rollup plugins use the
writeBundle
hook, to run tools after all chunks and assets have been emitted, this hook however is never called with the vite build system since instead of using rollups bundle.write method it uses its own.Describe the solution you'd like
My suggestion would be to either call the writeBundle hook on all rollup plugins manually or implement a custom hook in the vite plugin interface that gets called after all assets have been written to disk.
Describe alternatives you've considered
There is not really a workaround with rollup,
you could try to detect filesystem changes manually or something I guess...You can run any script after vite build has finished but that is really awkward, requiring placeholder scripts in the public folder, I think we can do better than that.
Additional context
Would solve #853 as then
rollup-plugin-workbox
would work again.It really should not be a big issue, if you want I can create a pull request for it!
The text was updated successfully, but these errors were encountered: