Vue cli project modify running command and port number

The default port number of the vue cli project is 8080, and the running command isnpm run serve

You can modify the running command in package.json, change the serve to dev, you can use the npm run devrunning project to
Insert picture description here
modify the running port number, you need to find the @vue folder in node_modules, there is a cli-service folder inside, and find the lib folder, commands folder, find the serve.js folder.
Sequence: node_modules --> @vue --> cli-service --> lib --> commands --> serve.js
Insert picture description here
Find defaults in the serve.js folder, modify the port to set the port number
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_36171287/article/details/114933525