unjs / unplugin

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

Make `webpack-sources` an optional peer dependency #410

Closed benmccann closed 2 months ago

benmccann commented 2 months ago

Describe the feature

webpack-sources is a dependency of this project and is pulled in whether or not you are using webpack. It is also a dependency of webpack, so I believe it could be made an optional peer dependency here

Additional information

danielroe commented 2 months ago

This breaks new Nuxt installs (and any other use of unplugin without webpack) as this is now imported directly into the main entrypoint of unplugin:

https://unpkg.com/browse/unplugin@1.13.0/dist/index.mjs

Maybe a dynamic import?