Maybe I simply haven’t gone down the Webpack rabbit hole deep enough. But to put my current understanding in simple terms:
-
Webpack’s use-case is geared completely towards JavaScript rendered pages - either in the browser or through JavaScript server side rendering. It wants to bundle everything, your JS, CSS, images, etc - and to get it’s dependency graph it looks at all of it.
-
EEx is Elixir server side templating as it was done in the pre-Node.js days and Brunch largely supports the needs of that style of (JQuery-era) web development. You manually decide what goes where and you decide how simple or fancy your setup is.
As far as I can tell EEx (Elixir) and Webpack (JavaScript) don’t easily mix as they represent totally different styles of web development. Now it may be possible to use EEx templates with Webpack but that would have to be entirely on Webpack’s terms and I doubt that there would be much value that EEx templating features could bring to the table.
People using Webpack with Phoenix typically are using React or Vue.js and therefore see no need for EEx features. But there still seems to be a significant audience for using Phoenix and server side templating with EEx - and I have yet to discover how Webpack could be coerced to support that style of web development - I suspect that for that scenario using Brunch is simply easier.
Ultimately Webpack may be too specialized (opinionated?) to become a universal default.