vue.config.js 541 B

1234567891011121314151617181920
  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. '/static': {
  14. target: 'http://localhost:9001', // 后端接口地址(开发阶段)
  15. changeOrigin: true,
  16. // pathRewrite: { '^/api': '/api' },
  17. }
  18. },
  19. },
  20. };