vue.config.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. const path = require('path')
  2. const version = new Date().getTime();
  3. module.exports = {
  4. lintOnSave: false,
  5. // lintOnSave: process.env.NODE_ENV !== 'production',
  6. publicPath: './', // 基本路径
  7. outputDir: 'dist', // 输出文件目录
  8. assetsDir: './assets',
  9. productionSourceMap: false,
  10. transpileDependencies: ['@supermap/iclient-common', '@supermap/iclient-leaflet'],
  11. devServer: {
  12. host: '0.0.0.0', // can be overwritten by process.env.HOST
  13. port: 8082, // 端口配置
  14. proxy: {
  15. "/arcMapServer/": {
  16. target: "http://10.36.128.38/", // 服务器端接口地址
  17. // target: "http://59.202.43.95:8801/spaceproject/",
  18. ws: true, //如果要代理 websockets,配置这个参数
  19. // 如果是https接口,需要配置这个参数
  20. changeOrigin: true, //是否跨域
  21. pathRewrite: {
  22. "^/arcMapServer": "/"
  23. }
  24. },
  25. "/arcMapServerTwo": {
  26. target: "http://10.249.2.51:6080/", // 服务器端接口地址
  27. ws: true, //如果要代理 websockets,配置这个参数
  28. // 如果是https接口,需要配置这个参数
  29. changeOrigin: true, //是否跨域
  30. pathRewrite: {
  31. "^/arcMapServerTwo": "/"
  32. }
  33. },
  34. '/ysgzybz': {
  35. // target: 'http://59.202.43.95:8801/kjzz/', // 服务器端接口地址
  36. target: 'http://localhost:7089/', // 服务器端接口地址
  37. ws: true, // 如果要代理 websockets,配置这个参数
  38. // 如果是https接口,需要配置这个参数
  39. changeOrigin: true, // 是否跨域
  40. pathRewrite: {
  41. '^/clzy': '/'
  42. }
  43. },
  44. '/arcMapServer2': {
  45. // target: 'http://59.202.43.95:8801/kjzz/', // 服务器端接口地址
  46. target: 'https://zdzy.zrzyt.zj.gov.cn/', // 服务器端接口地址
  47. ws: true, // 如果要代理 websockets,配置这个参数
  48. // 如果是https接口,需要配置这个参数
  49. changeOrigin: true, // 是否跨域
  50. pathRewrite: {
  51. '^/arcMapServer2': '/arcMapServer'
  52. }
  53. },
  54. '/gdzb': {
  55. target: 'https://gdzb.zrzyt.zj.gov.cn:10200/', // 服务器端接口地址
  56. ws: true, // 如果要代理 websockets,配置这个参数
  57. changeOrigin: true, // 是否跨域
  58. pathRewrite: {
  59. '^/gdzb': '/'
  60. }
  61. },
  62. '/zdzg': {
  63. target: 'https://kjly.zrzyt.zj.gov.cn:8184/', // 服务器端接口地址
  64. ws: true, // 如果要代理 websockets,配置这个参数
  65. changeOrigin: true, // 是否跨域
  66. pathRewrite: {
  67. '^/zdzg': '/'
  68. }
  69. },
  70. },
  71. overlay: {
  72. warnings: true,
  73. errors: false
  74. }
  75. },
  76. configureWebpack: {
  77. output: {
  78. sourcePrefix: " ",
  79. filename: `js/[name].${version}.js`,
  80. chunkFilename: `js/[name].${version}.js`
  81. },
  82. amd: {
  83. toUrlUndefined: true
  84. },
  85. resolve: {
  86. alias: {
  87. 'vue$': 'vue/dist/vue.esm.js',
  88. '@': path.resolve('src'),
  89. 'txml/txml': 'txml/dist/txml'
  90. // 'cesium': path.resolve(__dirname, cesiumSource)
  91. }
  92. },
  93. plugins: [
  94. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' }]),
  95. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' }]),
  96. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' }]),
  97. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'ThirdParty/Workers'), to: 'ThirdParty/Workers' }]),
  98. // new webpack.DefinePlugin({
  99. // CESIUM_BASE_URL: JSON.stringify('./')
  100. // })
  101. ],
  102. module: {
  103. unknownContextCritical: /^.\/.*$/,
  104. unknownContextCritical: false
  105. }
  106. },
  107. // 给css添加版本号
  108. // chainWebpack: config => {
  109. // config.plugin('extract-css').tap(args => [
  110. // {
  111. // filename: `assets/css/[name].${version}.css`,
  112. // chunkFilename: `assets/css/[name].${version}.css`
  113. // }
  114. // ])
  115. // }
  116. }