const { defineConfig } = require('@vue/cli-service')
let developmentPath = '/'; // 开发环境 - npm run serve 时引用文件路径
let productionPath = './';
module.exports = defineConfig({
publicPath: process.env.NODE_ENV === 'production' ? productionPath: developmentPath, // 基本路径-引用文件的路径
transpileDependencies: true,
lintOnSave: false,
devServer: {
proxy: {
// 此处若使用 "/api1" 类似命名可能会导致请求时只截取api部分接口出现404错误,因此命名时尽量避免此类命名方式。
// 既命名不要相似 有/api 就不要再出现/api2
'/CloudFilm': {
target: 'https://xxxx:8181/CloudFilm',
changeOrigin: true,
secure: false,
pathRewrite: {
'^/CloudFilm': '/'
}
},
},
},
})
vue.config.js