Vue.js How to change the default port number 8080 for the specified ports

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.