Conversation
| #### [📝 Full documentation ➡️](/packages/plugins/injection#readme) | ||
|
|
||
|
|
||
| ### True End |
There was a problem hiding this comment.
I find the name a bit weird (but I don't have a better suggestion :/)
what about onFullBuild?
There was a problem hiding this comment.
I find onFullBuild a bit misleading too, for instance in rollup the concept of buildEnd happens before the writeBundle, as-in, rollup (and vite) separate both the build from the write process.
Can you elaborate on what you find weird with "true end"?
Maybe we could go with just end?
There was a problem hiding this comment.
"true" doesn't really have a definition. And it sounds a bit more like something you'd say when speaking to someone vs something defined in a spec / technical document
There was a problem hiding this comment.
After some discussion offline, it's difficult to find a term that would really define this hook, cross bundler, so for now, until we get better consensus, we'll stick with true-end.
What and why?
Not all bundlers report the same
buildEndor evenwriteBundlehooks.rollupwill callwriteBundleas many times as there are outputs.esbuildhas a pretty inacuratebuildEnd.How?
Implement a more accurate
trueEndhook.Had to make both
syncTrueEndandasyncTrueEndbecause if your hook handler is asynchronous it can't execute at the same time as if it was synchronous, depending on the bundler...I added these details in the documentation:
In short, it's best to use
syncTrueEndif you can.