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

Explicitly add node_modules to cacheDirectories for Heroku #1202

Closed
wants to merge 1 commit into from

Conversation

rogermparent
Copy link
Contributor

Adding node_modules to cacheDirectories seems to download a more complete cache than the default behavior, despite the node buildpack docs saying node_modules are cached by default.

While out of the scope of a git PR, another part of reducing rebuild time on Heroku is setting the environment variable YARN_PRODUCTION to false so Heroku doesn't waste over a minute pruning devDependencies.
I tried just moving the Gatsby packages from devDependencies to dependencies, but it takes nearly as long to prune a minimal set of devDependencies as it does with all of them.
Even without pruning devDependencies we're way below the slug max, and I don't see it growing a few hundred MB any time soon. This will be even less of a problem once images are removed from the source repo, though if the images do pose a problem we should be able to remove them like public and .cache after the build.

This seems to be a more "full" cache than the default behavior, despite
the Heroku node buildpack docs stating node_modules is cached by default.
@rogermparent
Copy link
Contributor Author

rogermparent commented May 1, 2020

Hold on, I'll re-do this from a branch within the repo so we don't have to authorize the deploys.

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.

2 participants