Currently, Parcel’s plugin architecture makes it impossible to multiple plugins that run on the same file-extensions (as originally noted in #902). This is gonna be an issue in the long term, as more people start to extend Parcel with plugins, and will eventually require multiple plugins to be able to make changes to the same types of file 🚀
Right now plugins that want to “run” on certain files pretty much have to register a new asset-type to the desired file extension, and just point to their own custom asset which is able to then make the transforms etc that they intend.
This system doesn’t really make sense if you have 2, or even more, plugins that are all supposed to run on .js
files for example. All those plugins, extending JSAsset
, wouldn’t be able to run together sequentially, since they would pretty much override each other.
Ok great, so clearly we need to figure out how to make the plugin-system more flexible so that we can run multiple plugins on the same file-types, but then another huge issue immediately comes up:
How do we decide in what order to run the plugins!?
Currently, the way plugins get “registered”, is simply based on if we find them as a dependency in package.json
, which doesn’t allow the user to specify which order plugins should run in at all.
Evidently this is gonna require a pretty big overhaul of the way plugins work in Parcel, potentially requiring us to make some breaking changes 😬 (but maybe we can try to avoid it 🤷♂️)
CC @DeMoorJasper @devongovett
See my comment here for some thoughts on this: https://github.com/parcel-bundler/parcel/pull/919#issuecomment-369491271.
Id also like to be able to use custom cli args in my plugin, see #1020.
(btw assume I should comment here and not #919 as this is the open one?)
This will be solved by Parcel 2. Going to close this issue!