mariusbalcytis / webpack-bundle

Bundle to Integrate Webpack into Symfony
MIT License
122 stars 36 forks source link

CommonsChunkPlugin #54

Closed b4cedev closed 7 years ago

b4cedev commented 7 years ago

I'm working on a project that started as pure frontend (JS & co.) and is getting more and more coupled to Symfony backend parts. So i implemented webpack-bundle (0.6.1 currently) quite successful by imitating the default app/config/webpack.config.js behaviour with an own function that also adds a bunch of additional aliases, rules and plugins. This works great except for non-js assets not getting handled correctly. With the default config non-js assets get 2 entries in manifest: one of type js & one representing the file type (e.g. "jpg"). With my own config builder the asset type specific manifest entries disappear as soon as CommonsChunkPlugin comes into play. Any ideas why that is happening and how to avoid without dropping CommonsChunkPlugin?

P.S.: I know about new groups mechanism, but that's not quite what i need, as i have multiple "groups" depending on a common (heavy) collection of vendor libs and i18n data...

b4cedev commented 7 years ago

After describing it and thinking another while about it i found the reason... My chunk selection for commons chunk kind of consumed the additional asset entry points... Still no idea why only the type specific entries disappeared, but I got it working now.