vue.config.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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://192.168.1.23:8080', //请求本地 需要jeecg-boot后台项目 蒙蒙
  63. // target: 'http://192.168.1.22:8080', //请求本地 需要jeecg-boot后台项目 英豪
  64. // target: 'http://192.168.0.111: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.54:8080', //请求本地 需要jeecg-boot后台项目 孙震
  68. target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目 毕洁泉
  69. // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目 毕洁泉
  70. // target: 'http://192.168.1.251:80', //请求本地 需要jeecg-boot后台项目
  71. ws: false,
  72. changeOrigin: true,
  73. pathRewrite: {
  74. '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  75. }
  76. },
  77. },
  78. // before(app) {
  79. // app.get('/seller', (req, res) => {
  80. // res.json({
  81. // errno: 0,
  82. // data: appData
  83. // })//接口返回json数据,上面配置的数据seller就赋值给data请求后调用
  84. // })
  85. // }
  86. },
  87. lintOnSave: undefined
  88. }