Skip to content

[Question] Bundle/split external dependencies only #1781

Open

Description

@richarddd

Hi,

Is there any way to create "two" bundles. One with my sources and another one with my dependencies?
The main bundle should import the dependencies bundle.

Regards
Richard

Activity

  1. richarddd commented on Nov 17, 2021

    @richarddd
    Author

    @hyrious i opened this issue again because it's not an optimal solution. This will bundle ALL external dependencies and not just the ones you are using create a vendor.js bundle that is very large (in my case 15x larger than when everything is bundled in one file)

  2. hyrious commented on Nov 18, 2021

    @hyrious

    Yes this is just a quick solution but not optimal one. To analyze dependencies that are really in use, you must bundle once and look in the metafile, instead of just reading package.json.

    I'll suggest using vite to do this work for you, since it hooks into build process and automatically split dependencies into a vendor.js.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions