Issue
In my Angular2 node application this warning appears without making any changes to my application,
Warning
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. Assets: bundle.js (10.3 MB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance. Entrypoints: app (10.3 MB) bundle.js
WARNING in webpack performance recommendations: You can limit the size of your bundles by using System.import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/
Background
I am concerned with what the problem is. To understand it and how to fix it before it comes to needing a solution. My thought is that my design pattern is flawed.
Question
1. By changing the design pattern or architecture is this problem avoidable?
2. If so then how?
3. What exactly makes the application too large when this error is thrown?
4. Does this warning effect the application when it is in production, or only in development when using Webpack
to build the project?
Using Production Mode in Webpack. Running your project in production mode reduces the bundle sizes compared to the development mode. Webpack provides a separate flag ( -p ) to enable this feature and removes all the white spaces and newlines in the code.
Every React developer should add compression to their bundling process. One of the most impactful techniques to reduce the bundle size of a React application is compression. compression is a process in which the size of a file is reduced by re-encoding the file data to use fewer bits of storage than the original file.
More about this can be found at : https://github.com/webpack/webpack/issues/3216
If you want to disable this warning :
performance : {
hints : false
}
If you want to fix the issue : It was given in more detail in the above link. To simply put :
entry points
in webpack.bootstrap-loader
which will allow us to selectively on/off features/files/functionalities from bootstrap.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With