vue-cli 3.0配置

在vue项目根目录下新建vue.config.js,添加如下内容

module.exports={
    devServer: {
        port: 8000, // 端口号
        host: 'localhost',
        https: false, // https:{type:Boolean}
        open: true, //配置自动启动浏览器
        proxy: 'http://localhost:58156' // 配置跨域处理,只有一个代理
    }
}

其他配置细节还要参考官方文档
官网:https://cli.vuejs.org/
配置:https://cli.vuejs.org/config/#devserver

你可能感兴趣的:(vue-cli 3.0配置)