rollup / rollup/rollup

Add plugin hook that is called once for all outputs

Open
#3,536 2 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.