Skip to content

Commit 937baf4

Browse files
committed
Add --use-pnpm flag to create-next-app cli
1 parent 676fa37 commit 937baf4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/plugins/next.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,16 @@ export const nextPlugin = createPlugin({
8080
"--no-src-dir",
8181
"--import-alias=@/*",
8282
]
83-
if (flags["package-manager"] === "npm") {
84-
createNextAppArgs.push("--use-npm")
83+
switch (flags["package-manager"]) {
84+
case "pnpm":
85+
createNextAppArgs.push("--use-pnpm")
86+
break
87+
case "yarn":
88+
// default is yarn. And there's no flag for it.
89+
break
90+
case "npm":
91+
createNextAppArgs.push("--use-npm")
92+
break
8593
}
8694

8795
await runCommand("npx", [

0 commit comments

Comments
 (0)