vue.config.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙
  62. // target: 'http://192.168.0.111:8088', //请求本地 需要jeecg-boot后台项目 英豪
  63. // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目 祚云
  64. // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目 孙震
  65. // target: 'http://192.168.1.51:8088', //请求本地 需要jeecg-boot后台项目 毕洁泉
  66. // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目 毕洁泉
  67. <<<<<<< HEAD
  68. target: 'http://api.tjyourong.com.cn/jeecg-boot', //请求本地 需要jeecg-boot后台项目
  69. // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  70. =======
  71. // target: 'http://api.tjyourong.com.cn/jeecg-boot', //请求本地 需要jeecg-boot后台项目
  72. target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  73. >>>>>>> 6c6ca1355430eb6ec2be730b342e112441291393
  74. // target: 'http://192.168.1.251:8088', //请求本地 需要jeecg-boot后台项目
  75. // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
  76. ws: false,
  77. changeOrigin: true,
  78. pathRewrite: {
  79. '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  80. }
  81. },
  82. },
  83. // before(app) {
  84. // app.get('/seller', (req, res) => {
  85. // res.json({
  86. // errno: 0,
  87. // data: appData
  88. // })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
  89. // })
  90. // }
  91. },
  92. lintOnSave: undefined,
  93. // publicPath:'./'
  94. }