1 Star 0 Fork 0

springlives/springlives-console

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Phoenics Chow 提交于 2019-12-26 17:27 . init
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": ""
}
}
}
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/springlives/springlives-console.git
git@gitee.com:springlives/springlives-console.git
springlives
springlives-console
springlives-console
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385