Executing npm run Dev is actually at the call of the root directory of the Package.json
When you open Package.json, you can find a piece of code
"Scripts": { "dev": "Node Build/dev-server.js", "Build": "Node Build/build.js", "lint": "Eslint--ext. js, . Vue src " }
We should look at the Dev-server.js file under the build directory.
You can find it in the Dev-server.js file.
The port here is what we're looking for, and in the beginning of dev-server.js we can find
var path = require (' path ')
And where does path come from?
The root directory has a config folder, see the name to know the configuration, open the Config directory under the Index.js
Dev: { env:require ('./dev.env '), 8080, true, ' Static ', '/', proxytable: {}, false }
Not only can the port be changed, but other configuration information can be changed as needed.
Original link: http://blog.csdn.net/liyuxing6639801/article/details/60325558
For study only, infringement delete
Vue.js How to change the default port number 8080 for the specified ports