naive-ui/.pnpmfile.cjs

44 lines
878 B
JavaScript
Raw Permalink Normal View History

2022-07-07 01:43:35 +08:00
// We will lock vue version if there's regression
2022-05-27 02:32:55 +08:00
const lockVueVersion = false
const vueVersion = '3.2.36'
2022-05-20 03:54:44 +08:00
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)) {
2022-05-27 02:32:55 +08:00
pkg.version = vueVersion
2022-05-20 03:54:44 +08:00
}
;['dependencies', 'peerDependencies'].forEach((depsType) => {
const deps = { ...pkg[depsType] }
for (dep in pkg[depsType]) {
if (isSameVersionVuePackage(dep)) {
2022-05-27 02:32:55 +08:00
deps[dep] = vueVersion
2022-05-20 03:54:44 +08:00
}
}
pkg[depsType] = deps
})
return pkg
}
2022-05-27 02:32:55 +08:00
module.exports = lockVueVersion
? {
hooks: {
readPackage
}
}
: {}