Skip to content

Commit

Permalink
Merge pull request #11945 from snitin315/feat/pnpm
Browse files Browse the repository at this point in the history
feat: add pnpm support for installing CLI
  • Loading branch information
sokra committed Nov 20, 2020
2 parents 1936615 + fa7686c commit 044173e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions bin/webpack.js
Expand Up @@ -82,10 +82,17 @@ if (!cli.installed) {

console.error(notify);

const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
let packageManager;

if (fs.existsSync(path.resolve(process.cwd(), "yarn.lock"))) {
packageManager = "yarn";
} else if (fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"))) {
packageManager = "pnpm";
} else {
packageManager = "npm";
}

const packageManager = isYarn ? "yarn" : "npm";
const installOptions = [isYarn ? "add" : "install", "-D"];
const installOptions = [packageManager === "yarn" ? "add" : "install", "-D"];

console.error(
`We will use "${packageManager}" to install the CLI via "${packageManager} ${installOptions.join(
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Expand Up @@ -221,7 +221,8 @@
"opencollective",
"dependabot",
"browserslist",
"samsunginternet"
"samsunginternet",
"pnpm"
],
"ignoreRegExpList": ["/Author.+/", "/data:.*/", "/\"mappings\":\".+\"/"],
"ignorePaths": ["**/dist/**", "examples/**/README.md"]
Expand Down

0 comments on commit 044173e

Please sign in to comment.