Before thinking about a wrapper we should start with writing documentation how to use native webpack with Yii 3.
You mean an official tutorial to install & configure webpack to work nicely with Yii?
I’m all for it, and I would also love to see the same thing for gulp.
This actually would be a good first step towards coming up with our wrapper.
a framework can become quite unpopular in a rather short span of time, so we should not rely on a specific JS framework, but design Yii 3 to be flexible enough to use different ones.
Here we’re not talking about webpack anymore, but jQuery/Vue/React.
I totally agree with you: out of the box, Yii shouldn’t make any assumptions about what you’ll be using as JS framework (or bundler too).
Js frameworks have been indeed known to come & go, but some of them are here now, widely used and (imho) here to stay, like Vue or React.
It does make sense to me to provide enhanced support for those if we have enough resources. Vue ability to be integrated like jQuery (widgets) on a Yii outputted page makes it a really good candidate.
eg. we recently had to use config.optimization.delete('splitChunks')
in our config
at the comic strip! Yes, webpack can be a wild beast some times, and I’ve personally always end up using something wrapped around it that dumbs it down to my level of patience.
Thing is, we should avoid at any costs having to deal with webpack support issues at Yii, so our wrapper should just stay that, a wrapper, adding some handy shortcuts to quickly get you started.
All of webpack’s config should be totally controllable by the user, if he wants to dive into that.