vue.config.js 715 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict'
  2. const path = require('path')
  3. const port = process.env.port || process.env.npm_config_port || 9527 // dev port
  4. const options = {
  5. publicPath: '/index',
  6. outputDir: 'dist',
  7. indexPath: process.env.NODE_ENV === 'development' ? 'mer.html' : 'index.html',
  8. lintOnSave: process.env.NODE_ENV === 'development',
  9. productionSourceMap: false,
  10. devServer: {
  11. port: port,
  12. open: true,
  13. overlay: {
  14. warnings: false,
  15. errors: true
  16. },
  17. "proxy": {
  18. "/apis": {
  19. "target": "http://wap.tianlicn.cn/apis", //请求的目标域名
  20. "changeOrigin": true,
  21. // "secure": false,
  22. "pathRewrite": {
  23. '^/apis': ''
  24. }
  25. }
  26. }
  27. }
  28. }
  29. process.env.BASE_URL = options.publicPath;
  30. module.exports = options