@ngtools/webpack 13.2.2 → 13.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ngcc_processor.d.ts +1 -0
- package/src/ngcc_processor.js +16 -11
package/package.json
CHANGED
package/src/ngcc_processor.d.ts
CHANGED
package/src/ngcc_processor.js
CHANGED
|
@@ -72,15 +72,6 @@ class NgccProcessor {
|
|
|
72
72
|
const runHashBasePath = path.join(this._nodeModulesDirectory, '.cli-ngcc');
|
|
73
73
|
const projectBasePath = path.join(this._nodeModulesDirectory, '..');
|
|
74
74
|
try {
|
|
75
|
-
let lockData;
|
|
76
|
-
let lockFile = 'yarn.lock';
|
|
77
|
-
try {
|
|
78
|
-
lockData = (0, fs_1.readFileSync)(path.join(projectBasePath, lockFile));
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
lockFile = 'package-lock.json';
|
|
82
|
-
lockData = (0, fs_1.readFileSync)(path.join(projectBasePath, lockFile));
|
|
83
|
-
}
|
|
84
75
|
let ngccConfigData;
|
|
85
76
|
try {
|
|
86
77
|
ngccConfigData = (0, fs_1.readFileSync)(path.join(projectBasePath, 'ngcc.config.js'));
|
|
@@ -90,10 +81,11 @@ class NgccProcessor {
|
|
|
90
81
|
}
|
|
91
82
|
const relativeTsconfigPath = path.relative(projectBasePath, this.tsConfigPath);
|
|
92
83
|
const tsconfigData = (0, fs_1.readFileSync)(this.tsConfigPath);
|
|
84
|
+
const { lockFileData, lockFilePath } = this.findPackageManagerLockFile(projectBasePath);
|
|
93
85
|
// Generate a hash that represents the state of the package lock file and used tsconfig
|
|
94
86
|
const runHash = (0, crypto_1.createHash)('sha256')
|
|
95
|
-
.update(
|
|
96
|
-
.update(
|
|
87
|
+
.update(lockFileData)
|
|
88
|
+
.update(lockFilePath)
|
|
97
89
|
.update(ngccConfigData)
|
|
98
90
|
.update(tsconfigData)
|
|
99
91
|
.update(relativeTsconfigPath)
|
|
@@ -216,6 +208,19 @@ class NgccProcessor {
|
|
|
216
208
|
}
|
|
217
209
|
throw new Error(`Cannot locate the 'node_modules' directory.`);
|
|
218
210
|
}
|
|
211
|
+
findPackageManagerLockFile(projectBasePath) {
|
|
212
|
+
for (const lockFile of ['yarn.lock', 'pnpm-lock.yaml', 'package-lock.json']) {
|
|
213
|
+
const lockFilePath = path.join(projectBasePath, lockFile);
|
|
214
|
+
try {
|
|
215
|
+
return {
|
|
216
|
+
lockFilePath,
|
|
217
|
+
lockFileData: (0, fs_1.readFileSync)(lockFilePath),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch { }
|
|
221
|
+
}
|
|
222
|
+
throw new Error('Cannot locate a package manager lock file.');
|
|
223
|
+
}
|
|
219
224
|
}
|
|
220
225
|
exports.NgccProcessor = NgccProcessor;
|
|
221
226
|
class NgccLogger {
|