Vue way automatically open your browser configuration

Vue way automatically open your browser configuration

 

1. package.json configuration items

// must be compliant json syntax 
"VUE" : { 
     "devserver" : { 
         "Port": "8888" , 
         "Open": to true  
    } 
},         

Note: This configuration is not recommended. Because package.json mainly used to manage configuration information pack; for easy maintenance, recommended vue scaffolding related configuration, defined separately to vue.config.js profile.

 

 

2. Configure the project through a separate configuration file

// vue.config.js 
module.exports = { 
    devServer: { 
    port: 8888 
    } 
} 

① create a file in the root directory of the project vue.config.js

② carried out in the configuration file, overwriting the default configuration

 

Guess you like

Origin www.cnblogs.com/dlm17/p/12446666.html