Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

style-loader as vendor dependency? #320

Closed
asadsahi opened this issue Sep 19, 2016 · 4 comments
Closed

style-loader as vendor dependency? #320

asadsahi opened this issue Sep 19, 2016 · 4 comments

Comments

@asadsahi
Copy link

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?

image

@SteveSandersonMS
Copy link
Member

style-loader is 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
Copy link
Author

asadsahi commented Sep 19, 2016

@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.

@SteveSandersonMS
Copy link
Member

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.

@asadsahi
Copy link
Author

Okay interesting information about style-loader, didn't know there is some element in loader which is used in vendor bundles.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants