vue.config.js 1.1 KB

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