You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
const resolve = dir => {
|
|
|
|
return path.join(__dirname, dir)
|
|
|
|
}
|
|
|
|
// const BASE_URL = process.env.NODE_ENV === 'production'
|
|
|
|
// ? '/manager/'
|
|
|
|
// : '/'
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
baseUrl: '',
|
|
|
|
lintOnSave: false,
|
|
|
|
chainWebpack: config => {
|
|
|
|
config.resolve.alias
|
|
|
|
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
|
|
|
|
.set('_c', resolve('src/components'))
|
|
|
|
},
|
|
|
|
// 设为false打包时不生成.map文件
|
|
|
|
productionSourceMap: false,
|
|
|
|
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
|
|
|
|
// devServer: {
|
|
|
|
// proxy: 'localhost:3000'
|
|
|
|
// }
|
|
|
|
// devServer: {
|
|
|
|
// host: '0.0.0.0',
|
|
|
|
// https: false,
|
|
|
|
// disableHostCheck: true,
|
|
|
|
// proxy: 'http://192.168.0.22',
|
|
|
|
// port: 8080,
|
|
|
|
// },
|
|
|
|
devServer: {
|
|
|
|
host: '0.0.0.0',
|
|
|
|
https: false,
|
|
|
|
disableHostCheck: true,
|
|
|
|
port: 8080,
|
|
|
|
proxy: {
|
|
|
|
'/cgi-bin': {
|
|
|
|
target: 'http://192.168.0.250',
|
|
|
|
changeOrigin: true
|
|
|
|
// pathRewrite: {
|
|
|
|
// '^/cgi-bin': 'http://192.168.0.22'
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|