-
-
Notifications
You must be signed in to change notification settings - Fork 667
Add the ability to pick a package manager of choice while scaffolding #2768
Copy link
Copy link
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Currently, there isn't any way to specify a package manager of choice while generating the boilerplate (init | loader | plugin).
| const packager = this.utils.getPackageManager(); |
webpack-cli/packages/webpack-cli/lib/utils/get-package-manager.js
Lines 15 to 31 in 060268b
| const hasLocalNpm = fs.existsSync(path.resolve(process.cwd(), "package-lock.json")); | |
| if (hasLocalNpm) { | |
| return "npm"; | |
| } | |
| const hasLocalYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock")); | |
| if (hasLocalYarn) { | |
| return "yarn"; | |
| } | |
| const hasLocalPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml")); | |
| if (hasLocalPnpm) { | |
| return "pnpm"; | |
| } |
With the current approach, npm is always chosen if creating a new project in an empty directory.
Describe the solution you'd like
It'd be nice to have a prompt that shows up with the available installers so that one can go ahead with the preferred package manager.
Describe alternatives you've considered
N/A
Additional context
N/A
Reactions are currently unavailable