log文件引用报错处理,本地代理配置

This commit is contained in:
zxy
2024-02-04 13:38:23 +08:00
parent 7aec486f06
commit ef8cf0773c
3 changed files with 1805 additions and 2377 deletions

View File

@@ -1,40 +1,42 @@
module.exports = {
//路径前缀
publicPath: '/manage/',
outputDir: 'dist',
publicPath: "/manage/",
outputDir: "dist",
lintOnSave: true,
productionSourceMap: false,
chainWebpack: (config) => {
chainWebpack: config => {
//忽略的打包文件
config.externals({
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'element-ui': 'ELEMENT',
vue: "Vue",
"vue-router": "VueRouter",
vuex: "Vuex",
axios: "axios",
"element-ui": "ELEMENT"
});
const entry = config.entry('app');
entry.add('babel-polyfill').end();
entry.add('classlist-polyfill').end();
entry.add('@/mock').end();
const entry = config.entry("app");
entry.add("babel-polyfill").end();
entry.add("classlist-polyfill").end();
entry.add("@/mock").end();
},
devServer: {
host: "0.0.0.0",
port: 1888,
proxy: {
'/api': {
"/api": {
//本地服务接口地址
target: 'http://localhost:8000',
target: "http://192.168.31.246:8000",
ws: true,
changeOrigin: true,
pathRewrite: {
'^/api': '/'
"^/api": "/"
}
},
'/api/map': {
"/api/map": {
//本地服务接口地址
target: 'http://apis.map.qq.com',
target: "http://apis.map.qq.com",
ws: true,
pathRewrite: {
'^/api/map': '/'
"^/api/map": "/"
}
}
}