vue.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // 配置路径别名
  2. var path = require('path')
  3. function resolve (dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. module.exports = {
  7. // 配置基础链接地址,根据发布环境添加 '/preview/bin-admin'
  8. publicPath: process.env.NODE_ENV === 'production'
  9. ? './'
  10. : '/',
  11. // dev跨域问题
  12. devServer: {
  13. port: 9800,
  14. /*proxy: {
  15. '/overview': { target: 'http://localhost:8082/' },
  16. '/public': { target: 'http://localhost:8082/' },
  17. '/union': { target: 'http://localhost:8082/' },
  18. '/map': { target: 'http://localhost:8082/' },
  19. '/summary': { target: 'http://localhost:8082/' },
  20. '/data': { target: 'http://localhost:5000/' }
  21. },*/
  22. proxy:"http://localhost:5000",
  23. overlay: {
  24. warnings: false,
  25. errors: false
  26. }
  27. },
  28. productionSourceMap: false,
  29. //lintOnSave: process.env.NODE_ENV !== 'production',
  30. lintOnSave: false,
  31. assetsDir: 'static',
  32. filenameHashing: true, // 发布打包文件是否有哈希后缀
  33. chainWebpack: config => {
  34. config.resolve.alias
  35. .set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
  36. }
  37. }