vue.config.js 637 B

1234567891011121314151617181920
  1. const {defineConfig} = require('@vue/cli-service')
  2. process.env = { ...process.env, ...require('dotenv').config().parsed };
  3. module.exports = defineConfig({
  4. transpileDependencies: true,
  5. devServer: {
  6. port:3000,
  7. proxy: {
  8. '/api': {
  9. target: 'http://192.168.1.178:8000', // 你的后端服务器地址
  10. ws: false, // 是否代理websockets
  11. changeOrigin: false, // 是否改变源地址
  12. pathRewrite: {
  13. '^/api': '/api' //实际请求地址是http://baidu.com/api/news/list
  14. }
  15. }
  16. }
  17. }
  18. })