vue.config.js 360 B

123456789101112131415
  1. // client/vue.config.js
  2. const path = require('path');
  3. module.exports = {
  4. outputDir: path.resolve(__dirname, 'dist'),
  5. publicPath: '/',
  6. devServer: {
  7. proxy: {
  8. '/api': {
  9. target: 'http://localhost:9001', // 后端接口地址(开发阶段)
  10. changeOrigin: true,
  11. // pathRewrite: { '^/api': '/api' },
  12. },
  13. },
  14. },
  15. };