Skip to content

Do plugins need to be of a single type? #4852

Answered by mischnic
jakearchibald asked this question in General
Discussion options

You must be logged in to vote

The idea for this is that these "hooks" have nothing to do with each other. So by splitting them up, running them in parallel is easier and we can provide a more idiomatic interface (e.g. compared to Webpack)

Is there a way to create a plugin that's formed of multiple plugins?

Yes: https://v2.parceljs.org/plugin-system/configuration/ (we should probably put this into the "authoring plugins" page as well).

For example, Preact's HMR implementation for Parcel (2 Transformer + 1 Runtime):

Demo (you extend some other config than @parcel/config-default) https://github.com/mischnic/preact-refresh/blob/dc2309c36048a34cf83bc6f2506b1d48518f97f2/packages/parcel-example/.parcelrc

The config that bu…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by DeMoorJasper
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants