unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more
https://unplugin.unjs.io
MIT License
2.9k stars 104 forks source link

feat: add top-level functions to create platform-specific plugins #301

Closed lforst closed 1 year ago

lforst commented 1 year ago

The current createUnplugin will not allow you to tree-shake unused code if you want to distribute individual plugins for each platform. I.e. the output may still contain webpack code even though you just want to create a rollup plugin.

This PR adds top-level methods to create plugins for the individual bundlers that are tree-shakable if unused.

antfu commented 1 year ago

That's nice! Can you also help to update the docs? Thank you!

lforst commented 1 year ago

@antfu added docs - feel free to adjust if needed :)

lforst commented 1 year ago

Small bump here in case this was forgotten - I wouldn't be mad if you decide not to go through with this PR 😄