vue.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. module.exports = {
  6. outputDir:'yxnaht',
  7. publicPath: './',
  8. lintOnSave: false ,
  9. productionSourceMap: false,
  10. devServer: {
  11. host: '0.0.0.0',
  12. open: true,
  13. proxy: {
  14. '/': {
  15. // target:'http://192.168.0.12:8082/',//测试
  16. // target:'http://192.168.0.2:7777/',//开发
  17. // target:'http://192.168.0.222:7777/',//开发
  18. // target:'http://192.168.0.20:7777/',//开发
  19. // target:'http://192.168.1.253:7777/',//测试
  20. // target:'http://data.cqna.gov.cn/',//线上
  21. target:'https://www.cqna.gov.cn',//线上
  22. changeOrigin: true,
  23. pathRewrite: {
  24. '^ /': ''
  25. }
  26. },
  27. },
  28. disableHostCheck: true,
  29. },
  30. chainWebpack(config) {
  31. // set svg-sprite-loader
  32. config.module
  33. .rule('svg')
  34. .exclude.add(resolve('src/icons'))
  35. .end()
  36. config.module
  37. .rule('icons')
  38. .test(/\.svg$/)
  39. .include.add(resolve('src/icons'))
  40. .end()
  41. .use('svg-sprite-loader')
  42. .loader('svg-sprite-loader')
  43. .options({ symbolId: 'icon-[name]' })
  44. .end()
  45. }
  46. }