38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
|
|
'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接口 需要配置这个参数
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
}
|