You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
frontend/vue.config.js

37 lines
1.3 KiB
JavaScript

const { defineConfig } = require("@vue/cli-service");
const path = require("path");
2 years ago
module.exports = defineConfig({
2 years ago
productionSourceMap: false, // 生产环境是否要生成 sourceMap
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
//assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",
2 years ago
outputDir: "dist", // 打包时输出的文件目录
assetsDir: "static", // 放置静态文件夹目录
2 years ago
transpileDependencies: true,
lintOnSave: false,
pluginOptions: {
"style-resources-loader": {
preProcessor: "less",
patterns: [
// 这个是加上自己的路径
path.resolve(__dirname, "./src/assets/css/global.less"),
],
},
},
2 years ago
devServer: {
proxy: {
2 years ago
"/api": {
//表示拦截以/api开头的请求路径
//表示拦截以/api开头的请求路径
//target: 'http://localhost:1234', //本地nodejs服务器
target: "http://47.96.238.157:8093", //公司项目服务器环境
2 years ago
//target: "http://180.166.218.222:40080", //dell
//target: 'http://180.166.218.222:7200',
changOrigin: true, //是否开启跨域
pathRewrite: {
2 years ago
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的
},
},
},
},
});