Files
hospital_project_vue/vue.config.js
2026-03-27 19:16:27 +08:00

40 lines
842 B
JavaScript

// module.exports = {
// devServer: {
// port: 8081,
// proxy: {
// '/api': {
// target: 'http://47.105.32.17:8888',
// changeOrigin: true,
// pathRewrite: {
// '^/api': ''
// }
// }
// }
// }
// }
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig(() => {
const NODE_ENV = 'development'
return {
devServer: {
port: 8081,
proxy: {
'/api': {
// target: 'http://47.105.32.17:8888',
target: 'http://10.157.100.138:8888',
changeOrigin: true,
pathRewrite: { '^/api': '' }
}
}
},
// 公共路径:生产环境加 /pc/,开发环境用 /
publicPath: NODE_ENV === 'production' ? '/pc/' : '/',
outputDir: 'dist',
assetsDir: 'assets',
}
})