From 4d07ee5bda3e0064771c2df317f05db36405cfef Mon Sep 17 00:00:00 2001 From: Boris Kubiak Date: Tue, 23 Jul 2019 10:50:26 +0200 Subject: [PATCH] feat(cli): add --port argument to 'vue serve' command --- docs/guide/prototyping.md | 7 ++++--- packages/@vue/cli/bin/vue.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/guide/prototyping.md b/docs/guide/prototyping.md index b30042791b..c56a7d03bc 100644 --- a/docs/guide/prototyping.md +++ b/docs/guide/prototyping.md @@ -20,9 +20,10 @@ serve a .js or .vue file in development mode with zero config Options: - -o, --open Open browser - -c, --copy Copy local url to clipboard - -h, --help output usage information + -o, --open Open browser + -c, --copy Copy local url to clipboard + -p, --port Port used by the server (default: 8080 or next available port) + -h, --help Output usage information ``` All you need is an `App.vue` file: diff --git a/packages/@vue/cli/bin/vue.js b/packages/@vue/cli/bin/vue.js index 8161aad511..0e0d5f19c0 100755 --- a/packages/@vue/cli/bin/vue.js +++ b/packages/@vue/cli/bin/vue.js @@ -117,6 +117,7 @@ program .description('serve a .js or .vue file in development mode with zero config') .option('-o, --open', 'Open browser') .option('-c, --copy', 'Copy local url to clipboard') + .option('-p, --port ', 'Port used by the server (default: 8080 or next available port)') .action((entry, cmd) => { loadCommand('serve', '@vue/cli-service-global').serve(entry, cleanArgs(cmd)) })