File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,12 @@ $ npm install -g vue-cli
18
18
$ vue init webpack my-project
19
19
$ cd my-project
20
20
$ npm install
21
+ # run at default port 8080
21
22
$ npm run dev
23
+ # run at port 6060
24
+ $ npm run dev -- --port 6060
22
25
```
23
26
24
- If port 8080 is already in use on your machine you must change the port number in ` /config/index.js ` . Otherwise ` npm run dev ` will fail.
25
-
26
27
## What's Included
27
28
28
29
- ` npm run dev ` : first-in-class development experience.
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ var webpackConfig = {{#if_or unit e2e}}(process.env.NODE_ENV === 'testing' || pr
16
16
17
17
// default port where dev server listens for incoming traffic
18
18
var port = process . env . PORT || config . dev . port
19
+ var portIndex = process . argv . indexOf ( '--port' )
20
+ if ( portIndex !== - 1 ) {
21
+ port = process . argv [ portIndex + 1 ] || port ;
22
+ }
19
23
// automatically open browser, if not set will be false
20
24
var autoOpenBrowser = ! ! config . dev . autoOpenBrowser
21
25
// Define HTTP proxies to your custom API backend
You can’t perform that action at this time.
0 commit comments