vue.config.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. var appData = require('./json/video.json')//加载本地数据文件
  6. // vue.config.js
  7. module.exports = {
  8. /*
  9. Vue-cli3:
  10. Crashed when using Webpack `import()` #2463
  11. https://github.com/vuejs/vue-cli/issues/2463
  12. */
  13. // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
  14. productionSourceMap: false,
  15. /*
  16. pages: {
  17. index: {
  18. entry: 'src/main.js',
  19. chunks: ['chunk-vendors', 'chunk-common', 'index']
  20. }
  21. },
  22. */
  23. configureWebpack: {},
  24. chainWebpack: (config) => {
  25. config.resolve.alias
  26. .set('@$', resolve('src'))
  27. .set('@api', resolve('src/api'))
  28. .set('@assets', resolve('src/assets'))
  29. .set('@comp', resolve('src/components'))
  30. .set('@views', resolve('src/views'))
  31. .set('@layout', resolve('src/layout'))
  32. .set('@static', resolve('src/static'))
  33. },
  34. css: {
  35. loaderOptions: {
  36. less: {
  37. modifyVars: {
  38. /* less 变量覆盖,用于自定义 ant design 主题 */
  39. /*
  40. 'primary-color': '#F5222D',
  41. 'link-color': '#F5222D',
  42. 'border-radius-base': '4px',
  43. */
  44. },
  45. javascriptEnabled: true,
  46. }
  47. }
  48. },
  49. devServer: {
  50. port: 3000,
  51. proxy: {
  52. /* '/api': {
  53. target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统
  54. ws: false,
  55. changeOrigin: true,
  56. pathRewrite: {
  57. '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  58. }
  59. },*/
  60. '/jeecg-boot': {
  61. // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目 生产环境
  62. target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
  63. // target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙
  64. // target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目 英豪
  65. // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
  66. // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目 祚云
  67. // target: 'http://192.168.1.127:8080', //请求本地 需要jeecg-boot后台项目 孙震
  68. // target: 'http://192.168.43.119:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙,手机热点
  69. ws: false,
  70. changeOrigin: true
  71. },
  72. },
  73. // before(app) {
  74. // app.get('/seller', (req, res) => {
  75. // res.json({
  76. // errno: 0,
  77. // data: appData
  78. // })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
  79. // })
  80. // }
  81. },
  82. lintOnSave: undefined
  83. }