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

Prefer local packages when present in cache #913

Merged
merged 4 commits into from
Sep 1, 2021

Conversation

geoffharcourt
Copy link
Contributor

@geoffharcourt geoffharcourt commented Apr 28, 2021

This change updates the yarn install step to use the
--prefer-offline argument. This chaneg avoids reinstalling
already-present packages when the local cache has them. Yarn's
default behavior is to attempt to install packages from the network before
falling back to the local cache, which can be unnecessarily time-consuming.

We've been using this change in our buildpack fork for months and it's
improved our build times (we think?) and have not experienced any issues.

Related:
yarnpkg/yarn#6398

This change updates the `yarn install` step to use the
`--prefer-offline` argument. This avoids reinstalling already-present
packages when the local cache has them.
@geoffharcourt geoffharcourt requested a review from a team as a code owner April 28, 2021 01:20
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

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

(Switching review to the Node.js SME, to get this out of the languages team review queue)

@edmorley edmorley requested a review from joshwlewis August 31, 2021 09:14
@joshwlewis
Copy link
Member

Hi @geoffharcourt -- This looks good to me. Can you add a changelog entry to the unreleased section, so we can get all the checks green here?

@geoffharcourt
Copy link
Contributor Author

@joshwlewis pushed! Thanks for the review.

@joshwlewis joshwlewis merged commit b44600c into heroku:main Sep 1, 2021
@joshwlewis joshwlewis mentioned this pull request Sep 2, 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.

3 participants