Skip to content

Commit 59d3e74

Browse files
bokubhaoqunjiang
authored andcommitted
feat: add --port argument to 'vue serve' command (#4342)
1 parent 2d59c96 commit 59d3e74

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/guide/prototyping.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ serve a .js or .vue file in development mode with zero config
2020
2121
Options:
2222
23-
-o, --open Open browser
24-
-c, --copy Copy local url to clipboard
25-
-h, --help output usage information
23+
-o, --open Open browser
24+
-c, --copy Copy local url to clipboard
25+
-p, --port <port> Port used by the server (default: 8080 or next available port)
26+
-h, --help Output usage information
2627
```
2728

2829
All you need is an `App.vue` file:

packages/@vue/cli/bin/vue.js

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ program
117117
.description('serve a .js or .vue file in development mode with zero config')
118118
.option('-o, --open', 'Open browser')
119119
.option('-c, --copy', 'Copy local url to clipboard')
120+
.option('-p, --port <port>', 'Port used by the server (default: 8080 or next available port)')
120121
.action((entry, cmd) => {
121122
loadCommand('serve', '@vue/cli-service-global').serve(entry, cleanArgs(cmd))
122123
})

0 commit comments

Comments
 (0)