Skip to content

Commit c8039a5

Browse files
committed
chore: allow dynamic set port
1 parent 1909018 commit c8039a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vue.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ function resolve(dir) {
77
}
88

99
const name = defaultSettings.title || 'vue Element Admin' // page title
10+
1011
// If your port is set to 80,
1112
// use administrator privileges to execute the command line.
1213
// For example, Mac: sudo npm run
13-
const port = 9527 // dev port
14+
// You can change the port by the following method:
15+
// port = 9527 npm run dev OR npm run dev --port = 9527
16+
const port = process.env.port || process.env.npm_config_port || 9527 // dev port
1417

1518
// All configuration item explanations can be find in https://cli.vuejs.org/config/
1619
module.exports = {

0 commit comments

Comments
 (0)