Skip to content

Commit

Permalink
[ARGG-948]: Update caching strategy for SSR build (#182)
Browse files Browse the repository at this point in the history
* [ARGG-948]: Update caching strategy for SSR build

* [ARGG-948]: fix CI pipeline

---------

Co-authored-by: Aleksandr Sannikov <aleksandr.sannikov@skyscanner.net>
  • Loading branch information
xalechez and Aleksandr Sannikov committed Jan 10, 2024
1 parent ea7c7f9 commit e63d6c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [fork_cra5]
branches: [main]
pull_request:
branches: [fork_cra5]
branches: [main]

jobs:
build:
Expand Down
6 changes: 3 additions & 3 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
appWebpackCache: resolveApp('node_modules/.cache'),
appWebpackCache: resolveApp('node_modules/.cache/webpack'),
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
swSrc: resolveModule(resolveApp, 'src/service-worker'),
publicUrlOrPath,
Expand Down Expand Up @@ -105,7 +105,7 @@ module.exports = {
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
appWebpackCache: resolveApp('node_modules/.cache'),
appWebpackCache: resolveApp('node_modules/.cache/webpack'),
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
swSrc: resolveModule(resolveApp, 'src/service-worker'),
publicUrlOrPath,
Expand Down Expand Up @@ -146,7 +146,7 @@ if (
testsSetup: resolveModule(resolveOwn, `${templatePath}/src/setupTests`),
proxySetup: resolveOwn(`${templatePath}/src/setupProxy.js`),
appNodeModules: resolveOwn('node_modules'),
appWebpackCache: resolveOwn('node_modules/.cache'),
appWebpackCache: resolveOwn('node_modules/.cache/webpack'),
appTsBuildInfoFile: resolveOwn('node_modules/.cache/tsconfig.tsbuildinfo'),
swSrc: resolveModule(resolveOwn, `${templatePath}/src/service-worker`),
publicUrlOrPath,
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ module.exports = function (webpackEnv) {
},
cache: {
type: 'filesystem',
name: 'WebappCache',
version: createEnvironmentHash(env.raw),
cacheDirectory: paths.appWebpackCache,
store: 'pack',
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/config/webpack.config.ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ module.exports = function (webpackEnv) {
},
cache: {
type: 'filesystem',
name: 'SsrCache',
version: createEnvironmentHash(env.raw),
cacheDirectory: paths.appWebpackCache,
store: 'pack',
Expand Down

0 comments on commit e63d6c9

Please sign in to comment.