From 0afa4cd1eb29a446c0a6bceec5b0341cba7a6072 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 1 Sep 2021 11:41:17 +0200 Subject: [PATCH] push compilation output --- .../common/computeNodeModulesCacheKey.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/azure-pipelines/common/computeNodeModulesCacheKey.js b/build/azure-pipelines/common/computeNodeModulesCacheKey.js index b471d5c84cc..d15ceb6ef08 100644 --- a/build/azure-pipelines/common/computeNodeModulesCacheKey.js +++ b/build/azure-pipelines/common/computeNodeModulesCacheKey.js @@ -13,8 +13,17 @@ const shasum = crypto.createHash('sha1'); shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt'))); shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc'))); shasum.update(fs.readFileSync(path.join(ROOT, 'remote/.yarnrc'))); -// Add `yarn.lock` files +// Add `package.json` and `yarn.lock` files for (let dir of dirs) { + const packageJsonPath = path.join(ROOT, dir, 'package.json'); + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString()); + const relevantPackageJsonSections = { + dependencies: packageJson.dependencies, + devDependencies: packageJson.devDependencies, + optionalDependencies: packageJson.optionalDependencies, + resolutions: packageJson.resolutions + }; + shasum.update(JSON.stringify(relevantPackageJsonSections)); const yarnLockPath = path.join(ROOT, dir, 'yarn.lock'); shasum.update(fs.readFileSync(yarnLockPath)); }