From 9f1f8d09729eef25b2cce295898b47b6b3d6879b Mon Sep 17 00:00:00 2001 From: Aleksandr Sannikov Date: Wed, 10 Jan 2024 15:27:03 +0000 Subject: [PATCH 1/2] [ARGG-948]: Update caching strategy for SSR build --- packages/react-scripts/config/paths.js | 6 +++--- packages/react-scripts/config/webpack.config.js | 1 + packages/react-scripts/config/webpack.config.ssr.js | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index f716fa2da2..4bf961e6b4 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -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, @@ -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, @@ -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, diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index beaec410ea..2e21bb0e5b 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -244,6 +244,7 @@ module.exports = function (webpackEnv) { }, cache: { type: 'filesystem', + name: 'WebappCache', version: createEnvironmentHash(env.raw), cacheDirectory: paths.appWebpackCache, store: 'pack', diff --git a/packages/react-scripts/config/webpack.config.ssr.js b/packages/react-scripts/config/webpack.config.ssr.js index 199c763c3c..05b25d7ea4 100644 --- a/packages/react-scripts/config/webpack.config.ssr.js +++ b/packages/react-scripts/config/webpack.config.ssr.js @@ -252,6 +252,7 @@ module.exports = function (webpackEnv) { }, cache: { type: 'filesystem', + name: 'SsrCache', version: createEnvironmentHash(env.raw), cacheDirectory: paths.appWebpackCache, store: 'pack', From 0fc81627a7f3ad065cf88add565874976f9b39a9 Mon Sep 17 00:00:00 2001 From: Aleksandr Sannikov Date: Wed, 10 Jan 2024 15:35:35 +0000 Subject: [PATCH 2/2] [ARGG-948]: fix CI pipeline --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e568561d64..d6d136b77b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build on: push: - branches: [fork_cra5] + branches: [main] pull_request: - branches: [fork_cra5] + branches: [main] jobs: build: