[unplugin] Why using require('webpack-sources')
instead of require('webpack').sources
?
#37
-
Hello there 👋 I've seen a few issues slightly approaching the subject of From what I gathered, the need for it was introduced in unjs/unplugin#57. It's proven difficult, from a consumer of unplugin's point of view, to fully understand what needs to be declared as a peerDependency, a dependency, or other. Webpack do advise to use Tip When consuming Right now, I'm afraid we do break this compatibility for older versions of webpack, currently, v4 uses webpack-sources@v1, by enforcing a version of webpack-sources onto webpack. Mostly trying to understand the decision before applying changes (either via a PR, or directly in my code). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
cc @antfu for visibility and maybe a chance to get more context on this. |
Beta Was this translation helpful? Give feedback.
-
I see. I am up to moving to |
Beta Was this translation helpful? Give feedback.
It was a sync import, and I was trying not to include the whole webpack for every single unplugin. But as for now it's moved to lazy require, we could change to webpack then.