vue.config.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. hot:true,
  51. // inline: true,
  52. port: 3000,
  53. open : true,
  54. proxy: {
  55. '/jeecg-boot': {
  56. target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙
  57. // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目 英豪
  58. // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目 英豪
  59. // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目 祚云
  60. // target: 'http://192.168.1.94:8088', //请求本地 需要jeecg-boot后台项目 孙震
  61. // target: 'http://192.168.0.230:8088', //请求本地 需要jeecg-boot后台项目 孙震
  62. // target: 'http://192.168.1.51:8080', //请求本地 需要jeecg-boot后台项目 毕洁泉
  63. // target: 'http://192.168.1.74:8098', //请求本地 需要jeecg-boot后台项目 毕洁泉
  64. // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目 毕洁泉
  65. // target: 'http://192.168.0.170:8088', //请求本地 需要jeecg-boot后台项目 毕洁泉
  66. // target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  67. // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  68. // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
  69. // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
  70. // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
  71. // target:'http://118.24.244.213:8804',
  72. ws: false,
  73. changeOrigin: true,
  74. // pathRewrite: {
  75. // '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  76. // }
  77. },
  78. },
  79. // before(app) {
  80. // app.get('/seller', (req, res) => {
  81. // res.json({
  82. // errno: 0,
  83. // data: appData
  84. // })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
  85. // })
  86. // }
  87. },
  88. lintOnSave: undefined,
  89. // publicPath:'./'
  90. }