AngularWebpackVisualStudio
AngularWebpackVisualStudio copied to clipboard
Use optimization.splitChunks instead of separate entry points (Webpack 4)
Currently the vendors
and polyfills
bundles are created as separate entry points. However, in Webpack 4 this is not acceptable. From the documentation:
In webpack version < 4 it was common to add vendors as separate entrypoint to compile it as separate file (in combination with the
CommonsChunkPlugin
). This is discouraged in webpack 4. Instead theoptimization.splitChunks
option takes care of separating vendors and app modules and creating a separate file. Do not create an entry for vendors or other stuff which is not the starting point of execution.