代码拉取完成,页面将自动刷新
const path = require("path");
const resolve = dir => {
return path.join(__dirname, dir);
};
// 项目部署目录,相对于根目录
const WWW_ROOT = process.env.NODE_ENV === "production" ? "/up-admin/" : "/";
module.exports = {
publicPath: WWW_ROOT,
chainWebpack: config => {
config.resolve.alias.set("@", resolve("src")); // key,value自行定义,比如.set('@@', resolve('src/components'))
const svgRule = config.module.rule("svg");
svgRule.uses.clear();
svgRule
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({ symbolId: "icon-[name]" });
},
// 打包时不生成.map文件
productionSourceMap: false,
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
devServer: {
proxy: {
"/api/": {
//target: BASE_URL, // 设置你调用的接口域名和端口号 别忘了加http
target: "http://localhost:8099/",
changeOrigin: true,
pathRewrite: {
"^/api": ""
}
}
}
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。