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

Description

@asadsahi

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

Activity

  1. SteveSandersonMS commented on Sep 19, 2016

    @SteveSandersonMS
    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 :)

  2. asadsahi commented on Sep 19, 2016

    @asadsahi
    Author

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

  3. SteveSandersonMS commented on Sep 19, 2016

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

  4. asadsahi commented on Sep 19, 2016

    @asadsahi
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions