Shu_Ju_Wei_Hu_Ping_Tai/vue.config.js

38 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'use strict'
const path = require('path')
const { CONFIG } = require("./public/settings/config");
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
name: CONFIG.TITLE,
resolve: {
alias: {
'@': resolve('src')
}
}
},
lintOnSave: false,
devServer: {
overlay: {
warning: false,
errors: false
},
contentBase: path.join(__dirname, 'dist'),
proxy: {
[path.join(__dirname)]: {
target: path.join(__dirname), //后端接口地址 设置代理服务器地址 转发地址
ws: true,//WebSocket协议
changeOrigin: true, //表示是否改变原域名这个一定要选择为true; 是否允许跨域[ 如果接口跨域 则要配置这个参数]
// secure: false, // 如果是https接口 需要配置这个参数
}
}
},
}