vue.config.js 1.5 KB

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