vue.config.js配置
上代码
module.exports = {
// 输出文件目录
outputDir: 'dist',
lintOnSave: true,
chainWebpack: config => {
const svgRule = config.module.rule('svg');
svgRule.uses.clear();
svgRule
.use('vue-svg-loader')
.loader('vue-svg-loader');
},
devServer: {
open: true, //是否自动弹出浏览器页面
host: "localhost",
port: '8081',
https: false,
hotOnly: false
// ,proxy: {
// '/api': {
// target: 'http://localhost:8080', //API服务器的地址
// ws: true, //代理websockets
// changeOrigin: true // 虚拟的站点需要更管origin
// //pathRewrite: { //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
// // '^/api': ''
// //}
// }
// }
}
}