Skip to content

Commit 9730e83

Browse files
committed
chore: add custom port configuration
1 parent 250f44d commit 9730e83

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ npm run e2e
2727
npm test
2828
```
2929

30+
You can provide custom port-numbers via the environment variable `PORT`:
31+
32+
```sh
33+
# run dev-server on port 1337
34+
PORT=1337 node run dev
35+
36+
# run e2e tests on port 8888
37+
PORT=8888 node run e2e
38+
```
39+
3040
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
3141

3242
## Demo

config/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
},
2727
dev: {
2828
env: devEnv,
29-
port: 8080,
29+
port: process.env.PORT || 8080,
3030
autoOpenBrowser: true,
3131
assetsSubDirectory: 'static',
3232
assetsPublicPath: '/',

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"scripts": {
1616
"prepush": "npm run eslint",
1717
"dev": "node build/dev-server.js",
18-
"start": "node build/dev-server.js",
18+
"start": "npm run dev",
1919
"build": "node build/build.js",
2020
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
21-
"e2e": "cross-env PORT=8082 node test/e2e/runner.js",
21+
"e2e": "node test/e2e/runner.js",
2222
"test": "npm run unit && npm run e2e",
2323
"eslint": "eslint --ext .js,.vue build config src test/unit/specs test/e2e/specs"
2424
},

0 commit comments

Comments
 (0)