Skip to content

Why do output plugins run before input plugins? #3845

@aleclarson

Description

@aleclarson

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

If both an input plugin and output plugin have a generateBundle hook, the output plugin's hook runs first.
Is there a reason for this?

Your Proposal for Changes

Run output plugins last (if possible?).

Or provide a method on PluginContext that allows a hook to postpone itself until other hooks for the same phase have finished, like this:

async generateBundle() {
  await this.postpone()
  // Do stuff after all non-postponed `generateBundle` hooks have finished.
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions