Add plugin hook that is called once for all outputs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 26.3k
- Forks
- 1.8k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 20
Description
With rollup for the same input I generate two outputs: ES and UMD. I want to tweak @rollup/plugin-html to generate a single index.html containg
<script type='module' src='es/x.js'></script>
<script nomodule src='und/x.js'></script>
As far as I can see the writeBundle and generateBundle hooks are called per output, when output is an array. But the index.html file has to be generated only once for all outputs, so it shall have a hook that is called at the very end.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Rollup's generateBundle and writeBundle hook handling, especially how they are invoked when output is an array. Trace the output-generation lifecycle and determine where a once-per-build hook would fit. Done means the requested hook has clearly defined semantics for all outputs and supports generating one combined index.html.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100