vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 = 'http://10.64.81.2: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. title: '椰子后台管理系统程序'
  20. },
  21. },
  22. devServer: {
  23. open: true,
  24. // host: 'localhost',
  25. host: '192.168.1.128',
  26. port: 3333,
  27. https: false,
  28. //以上的ip和端口是我们本机的;下面为需要跨域的
  29. proxy: {//配置跨域
  30. '/api': {
  31. target: targetUrl,//这里后台的地址模拟的;应该填写你们真实的后台接口
  32. ws: true,
  33. changOrigin: true,//允许跨域
  34. pathRewrite: {
  35. '^/api': ''//请求的时候使用这个api就可以
  36. }
  37. }
  38. }
  39. },
  40. }