vue.config.js 1.1 KB

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