mirror of https://github.com/webpack/webpack.git
refactor: packageManager logic for perf improvement
This commit is contained in:
parent
c885f6d7dc
commit
e827f4fc44
|
@ -82,8 +82,19 @@ if (!cli.installed) {
|
||||||
|
|
||||||
console.error(notify);
|
console.error(notify);
|
||||||
|
|
||||||
const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
|
const isNpm = fs.existsSync(path.resolve(process.cwd(), "package-lock.json"));
|
||||||
const isPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"));
|
|
||||||
|
let isYarn = false;
|
||||||
|
|
||||||
|
if (!isNpm) {
|
||||||
|
isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let isPnpm = false;
|
||||||
|
|
||||||
|
if (!isYarn) {
|
||||||
|
isPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"));
|
||||||
|
}
|
||||||
|
|
||||||
let packageManager;
|
let packageManager;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue