vue.config.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. const url = 'https://ht.test.prpiano.com'
  2. const path = require('path')
  3. module.exports = {
  4. //打包配置,解决页面空白的配置方案。
  5. publicPath: './', //输出的根路径 默认是/ 如果你的网站是app.com/vue 这更改此配置项
  6. lintOnSave: true,
  7. runtimeCompiler: true,
  8. //webpack配置
  9. configureWebpack: {
  10. //关闭 webpack 的性能提示
  11. performance: {
  12. hints: false
  13. }
  14. },
  15. pages: {
  16. index: {
  17. // 入口文件
  18. entry: 'src/main.js' /*这个是根入口文件*/ ,
  19. // 模板文件
  20. template: 'public/index.html',
  21. // 输出文件
  22. filename: 'index.html',
  23. // 页面title
  24. title: '数字云帆',
  25. assetsPublicPath: './'
  26. }
  27. },
  28. devServer: {
  29. port: "8081", //代理端口
  30. open: false, //项目启动时是否自动打开浏览器,我这里设置为false,不打开,true表示打开
  31. proxy: {
  32. '/agroa': { //代理api
  33. target: url, // 代理接口
  34. changeOrigin: true, //是否跨域
  35. ws: true, // proxy websockets
  36. },
  37. '/classlive': { //代理api
  38. target: url, // 代理接口
  39. changeOrigin: true, //是否跨域
  40. ws: true, // proxy websockets
  41. },
  42. '/api': { //代理api
  43. target: url, // 代理接口
  44. changeOrigin: true, //是否跨域
  45. ws: true, // proxy websockets
  46. },
  47. '/liveController': { //代理api
  48. target: url, // 代理接口
  49. changeOrigin: true, //是否跨域
  50. ws: true, // proxy websockets
  51. },
  52. }
  53. }
  54. }