vue.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // const targetUrl = 'http://39.97.239.116:8080';
  2. const targetUrl = 'http://zngapi.hemadj.com:8080';
  3. // const targetUrl = 'http://192.168.1.200:8080';
  4. // const targetUrl = 'http://39.97.239.116:8080';
  5. // const targetUrl = 'http://api.zng.com:8080';
  6. module.exports = {
  7. publicPath:'./',
  8. productionSourceMap: false,
  9. pages: {
  10. index: {
  11. // page 的入口
  12. entry: 'src/main.js',
  13. // 模板来源
  14. template: 'public/index.html',
  15. // 在 dist/index.html 的输出
  16. filename: 'index.html',
  17. // 当使用 title 选项时,template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
  18. title: '航空工业集团快递智能柜管理程序'
  19. },
  20. },
  21. devServer: {
  22. open: true,
  23. // host: 'localhost',
  24. port: 8080,
  25. https: false,
  26. //以上的ip和端口是我们本机的;下面为需要跨域的
  27. proxy: {//配置跨域
  28. '/api': {
  29. target: targetUrl,//这里后台的地址模拟的;应该填写你们真实的后台接口
  30. ws: true,
  31. changOrigin: true,//允许跨域
  32. pathRewrite: {
  33. '^/api': ''//请求的时候使用这个api就可以
  34. }
  35. }
  36. }
  37. },
  38. }