Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webpack-chunks): Dont merge all modules into vendors #2082

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Mar 24, 2021

Fixes #2071

What?

Changes the webpack optimisation configuration. Key change was to remove "name", which was causing all imported modules to be grouped into a single vendor.bundle.js.

Things I've tested:

  • Groups a large module with the chunk for the page its included in
  • If the large module is used in more than one page, the large module has its own chunk and is imported for each page
  • It will only create a separate chunk for a large module if more than 1 page is using it (i.e. it is a shared chunk)

@dac09 dac09 requested a review from peterp March 24, 2021 13:06
@github-actions
Copy link

github-actions bot commented Mar 24, 2021

📦 PR Packages

Click to Show Package Download Links

https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/create-redwood-app-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-api-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-api-server-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-auth-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-cli-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-core-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-dev-server-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-eslint-config-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-eslint-plugin-redwood-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-forms-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-internal-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-prerender-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-router-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-structure-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-testing-0.28.0-b1d5a27.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2082/redwoodjs-web-0.28.0-b1d5a27.tgz

Install this PR by running yarn rw upgrade --pr 2082:0.28.0-b1d5a27

@dac09 dac09 added this to the next release milestone Mar 24, 2021
@thedavidprice thedavidprice removed this from the next release milestone Mar 24, 2021
Copy link
Contributor

@peterp peterp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rad, would love to see how this affects things!

@thedavidprice thedavidprice merged commit 49bea7c into redwoodjs:main Mar 25, 2021
@thedavidprice thedavidprice added this to the next release milestone Mar 25, 2021
@thedavidprice thedavidprice modified the milestones: next release, v0.28.1 Mar 30, 2021
@thedavidprice thedavidprice modified the milestones: v0.28.1, v0.29.0 Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve vendor chunk splits along routes
3 participants