You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Lack of knowledge perhaps, but anyone knows why we have style-loader in vendor manifest file to create DLL bundle? Shouldn't this file only have 3rd party libraries?
@SteveSandersonMS As I understand style-loader is like any other loader which handles a specific file type. Why we have only specified style-loader in vendor manifest and not ts-loader etc?
I have excluded it from vendor to try if it breaks anything, surprisingly it doesn't :)
However removing style-loader has also reduce my bundle size:
With style-loader:
vendor.js 2.18 MB 0 [emitted] vendor
Without style-loader:
vendor.js 1.77 MB 0 [emitted] vendor
And application still works. So, I am not sure if we need it, unless I am missing anything.
As I understand style-loader is like any other loader which handles a specific file type.
The difference is that style-loader has a runtime portion, so you have to make a choice about where that runtime code should go: in your vendor bundle, or your main bundle.
In the Angular2Spa template right now, style-loader is not actually used at all (because of its incompatibility with server-side prerendering), so it can be removed altogether. Thanks for drawing my attention to this! I'm removing it from the default Angular2Spa template now.
However, it is used in the React and Knockout templates, so it will remain referenced from their vendor bundle configs.
Activity
SteveSandersonMS commentedon Sep 19, 2016
style-loaderis a 3rd-party library, so I'm not sure I understand the question.If you still think something is wrong, please reopen this issue with details :)
asadsahi commentedon Sep 19, 2016
@SteveSandersonMS As I understand
style-loaderis like any other loader which handles a specific file type. Why we have only specifiedstyle-loaderin vendor manifest and not ts-loader etc?I have excluded it from vendor to try if it breaks anything, surprisingly it doesn't :)
However removing
style-loaderhas also reduce my bundle size:With style-loader:
Without style-loader:
And application still works. So, I am not sure if we need it, unless I am missing anything.
SteveSandersonMS commentedon Sep 19, 2016
The difference is that
style-loaderhas a runtime portion, so you have to make a choice about where that runtime code should go: in your vendor bundle, or your main bundle.In the Angular2Spa template right now,
style-loaderis not actually used at all (because of its incompatibility with server-side prerendering), so it can be removed altogether. Thanks for drawing my attention to this! I'm removing it from the default Angular2Spa template now.However, it is used in the React and Knockout templates, so it will remain referenced from their vendor bundle configs.
asadsahi commentedon Sep 19, 2016
Okay interesting information about style-loader, didn't know there is some element in loader which is used in vendor bundles.
Thanks