-
Notifications
You must be signed in to change notification settings - Fork 1
/
pnpmfile.js
44 lines (35 loc) · 1.02 KB
/
pnpmfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* NOTICE: this is an auto-generated file
*
* This file has been generated for `pnpm install` task.
* It is used to pin client side dependencies.
* This file will be overwritten on every run.
*/
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
const versionsFile = require('path').resolve(__dirname, 'target/frontend/versions.json');
if (!fs.existsSync(versionsFile)) {
return;
}
const versions = JSON.parse(fs.readFileSync(versionsFile, 'utf-8'));
module.exports = {
hooks: {
readPackage
}
};
function readPackage(pkg) {
const {dependencies} = pkg;
if (dependencies) {
for (let k in versions) {
if (dependencies[k] && dependencies[k] !== versions[k]) {
pkg.dependencies[k] = versions[k];
}
}
}
// Forcing chokidar version for now until new babel version is available
// check out https://github.com/babel/babel/issues/11488
if (pkg.dependencies.chokidar) {
pkg.dependencies.chokidar = '^3.4.0';
}
return pkg;
}