vue.config.js 835 B

123456789101112131415161718192021222324
  1. module.exports = {
  2. publicPath: './',
  3. outputDir: 'dist',
  4. assetsDir: 'assets',
  5. devServer: {
  6. proxy: {
  7. [process.env.VUE_APP_BASE_API]: {
  8. target: 'http://localhost:8099/',
  9. changeOrigin: true,
  10. ws: true,
  11. timeout: 1000 * 60 * 10, // 传入请求的超时(以毫秒为单位) vuecli网址 https://cli.vuejs.org/zh/config/#css-loaderoptions
  12. proxyTimeout: 1000 * 60 * 10, // 代理未收到目标响应时的超时时间(以毫秒为单位) vue cli跳转proxy https://github.com/chimurai/http-proxy-middleware#proxycontext-config
  13. pathRewrite: {
  14. ['^' + process.env.VUE_APP_BASE_API]: ''
  15. }
  16. }
  17. },
  18. // Various Dev Server settings
  19. port: 8080 // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  20. }
  21. }