forked from tusen-ai/naive-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pnpmfile.cjs
43 lines (37 loc) · 878 Bytes
/
.pnpmfile.cjs
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
// We will lock vue version if there's regression
const lockVueVersion = false
const vueVersion = '3.2.36'
const isSameVersionVuePackage = (pkgName) =>
[
'vue',
'@vue/shared',
'@vue/compiler-sfc',
'@vue/server-renderer',
'@vue/reactivity',
'@vue/reactivity-transform',
'@vue/compiler-dom',
'@vue/compiler-ssr',
'@vue/compiler-core'
].some((name) => name === pkgName)
function readPackage(pkg) {
if (isSameVersionVuePackage(pkg.name)) {
pkg.version = vueVersion
}
;['dependencies', 'peerDependencies'].forEach((depsType) => {
const deps = { ...pkg[depsType] }
for (dep in pkg[depsType]) {
if (isSameVersionVuePackage(dep)) {
deps[dep] = vueVersion
}
}
pkg[depsType] = deps
})
return pkg
}
module.exports = lockVueVersion
? {
hooks: {
readPackage
}
}
: {}