pearofducks / rollup-plugin-dev

development server for rollup with additional logging and options

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using bundleEnd() is not late enough

pkit opened this issue · comments

writeBundle() will not fire yet, i.e. assets that are copied there will be unavailable.
And index.html is an asset...

I'm having the same issue. I'm using @rollup/plugin-html to generate the HTML as part of the rollup build before this plugin. The generated HTML cannot be found using the buildEnd rollup step. Using the writeBundle build step results in the correct behavior.

buildEnd doc: https://rollupjs.org/guide/en/#buildend

Called when rollup has finished bundling, but before generate or write is called; you can also return a Promise. If an error occurred during the build, it is passed on to this hook.

writeBundle doc: https://rollupjs.org/guide/en/#writebundle

If it is called, this is the last hook of the output generation phase and may again be followed by outputOptions if another output is generated. Called only at the end of bundle.write() once all files have been written. Similar to the generateBundle hook, bundle provides the full list of files being written along with their details.

@BryceMehring don't bother, wrote my own plugin instead. This one has too many problems.

@BryceMehring - thanks for providing useful enough information to form a reproduction of the problem rather than a one-line statement - I'll split this off into another issue since @pkit seems to just want to inject negativity into the process