vue.config.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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('@base', resolve('src/base'))
  28. .set('@api', resolve('src/api'))
  29. .set('@assets', resolve('src/assets'))
  30. .set('@comp', resolve('src/components'))
  31. .set('@views', resolve('src/views'))
  32. .set('@layout', resolve('src/layout'))
  33. .set('@static', resolve('src/static'))
  34. },
  35. pluginOptions: {
  36. 'style-resources-loader': {
  37. preProcessor: 'less',
  38. patterns: [
  39. resolve('src/styles/var.less'),
  40. resolve('src/styles/mixin.less')
  41. ]
  42. }
  43. },
  44. css: {
  45. loaderOptions: {
  46. less: {
  47. modifyVars: {
  48. /* less 变量覆盖,用于自定义 ant design 主题 */
  49. /*
  50. 'primary-color': '#F5222D',
  51. 'link-color': '#F5222D',
  52. 'border-radius-base': '4px',
  53. */
  54. },
  55. javascriptEnabled: true,
  56. }
  57. }
  58. },
  59. devServer: {
  60. hot:true,
  61. // inline: true,
  62. port: 3000,
  63. open : true,
  64. proxy: {
  65. '/jeecg-boot': {
  66. target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙
  67. // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目 英豪
  68. // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目 英豪
  69. // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目 祚云
  70. // target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目 毕洁泉
  71. // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目 毕洁泉
  72. // target: 'http://192.168.1.43:8087', //请求本地 需要jeecg-boot后台项目 毕洁泉
  73. // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目 毕洁泉
  74. // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目 赵西安
  75. // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目 李煜一
  76. // target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  77. // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
  78. // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
  79. // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
  80. // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
  81. // target:'http://118.24.244.213:8804',
  82. // target:'http://139.186.151.174:8804', //测试
  83. ws: false,
  84. changeOrigin: true,
  85. // pathRewrite: {
  86. // '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  87. // }
  88. },
  89. },
  90. // before(app) {
  91. // app.get('/seller', (req, res) => {
  92. // res.json({
  93. // errno: 0,
  94. // data: appData
  95. // })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
  96. // })
  97. // }
  98. },
  99. lintOnSave: undefined,
  100. // publicPath:'./'
  101. }