Skip to content
Discussion options

You must be logged in to vote

For CI, the main approach is to cache the package manager's cache and reuse the installed dependencies when possible.

With npm, for example, GitHub Actions can cache the npm cache using actions/setup-node:

- uses: actions/setup-node@v4
  with:
    node-version: 20
    cache: npm

- run: npm ci
- run: npm run build

react-scripts itself doesn't provide a separate dependency-cache configuration. Dependency installation and caching are primarily handled by the package manager and CI environment.

If builds themselves are the bottleneck, caching dependencies will help with installation time, but it won't necessarily make the webpack compilation significantly faster.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by muazislambd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants