// const targetUrl = 'https://apizng.eavic.com';
// const targetUrl = 'http://39.97.239.116:8080';
// const targetUrl = 'http://192.168.1.200:8080';
const targetUrl = 'http://192.168.1.195/'
// const targetUrl = 'https://www.xyzshops.cn/'
// const targetUrl = 'http://10.64.81.2:8080';
module.exports = {
publicPath:'./',
productionSourceMap: false,
pages: {
index: {
// page 的入口
entry: 'src/main.js',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,template 中的 title 标签需要是
<%= htmlWebpackPlugin.options.title %>
// title: '航空工业集团快递智能柜管理程序'
title: '椰子充值后台管理系统程序'
},
},
devServer: {
open: true,
// host: 'localhost',
host: '192.168.1.130',
port: 3333,
https: false,
//以上的ip和端口是我们本机的;下面为需要跨域的
proxy: {//配置跨域
'/api': {
target: targetUrl,//这里后台的地址模拟的;应该填写你们真实的后台接口
ws: true,
changOrigin: true,//允许跨域
pathRewrite: {
'^/api': ''//请求的时候使用这个api就可以
}
},
}
},
chainWebpack: config => {
config.module
.rule("css")
.test(/\.css$/)
.oneOf("vue")
.resourceQuery(/\?vue/)
.use("px2rem")
.loader("px2rem-loader")
.options({
// remUnit: 192
remUnit: 210
});
}
}