From b9202ade9b913a2333fd86d622d4326f9c7698ba Mon Sep 17 00:00:00 2001 From: Stephy Cat Date: Mon, 1 Jul 2019 23:38:18 +0800 Subject: [PATCH] chore: allow dynamic set port (#389) --- vue.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vue.config.js b/vue.config.js index 18610d7..4244cfc 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,10 +7,13 @@ function resolve(dir) { } const name = defaultSettings.title || 'vue Admin Template' // page title + // If your port is set to 80, // use administrator privileges to execute the command line. // For example, Mac: sudo npm run -const port = 9528 // dev port +// You can change the port by the following methods: +// port = 9528 npm run dev OR npm run dev --port = 9528 +const port = process.env.port || process.env.npm_config_port || 9528 // dev port // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = {