vue.config.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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: 'https://zdzy.zrzyt.zj.gov.cn/ybzBjServer/', // 服务器端接口地址
  36. target: 'http://localhost:7089/', // 服务器端接口地址
  37. ws: true, // 如果要代理 websockets,配置这个参数
  38. // 如果是https接口,需要配置这个参数
  39. changeOrigin: true, // 是否跨域
  40. pathRewrite: {
  41. '^/ysgzybz': '/ysgzybz'
  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. '/arcMapServer3': {
  55. // target: 'http://59.202.43.95:8801/kjzz/', // 服务器端接口地址
  56. target: 'https://zdzy.zrzyt.zj.gov.cn/', // 服务器端接口地址
  57. ws: true, // 如果要代理 websockets,配置这个参数
  58. // 如果是https接口,需要配置这个参数
  59. changeOrigin: true, // 是否跨域
  60. pathRewrite: {
  61. '^/arcMapServer3': '/'
  62. }
  63. },
  64. '/gdzb': {
  65. target: 'https://gdzb.zrzyt.zj.gov.cn:10200/', // 服务器端接口地址
  66. ws: true, // 如果要代理 websockets,配置这个参数
  67. changeOrigin: true, // 是否跨域
  68. pathRewrite: {
  69. '^/gdzb': '/'
  70. }
  71. },
  72. '/zdzg': {
  73. target: 'https://kjly.zrzyt.zj.gov.cn:8184/', // 服务器端接口地址
  74. ws: true, // 如果要代理 websockets,配置这个参数
  75. changeOrigin: true, // 是否跨域
  76. pathRewrite: {
  77. '^/zdzg': '/'
  78. }
  79. },
  80. },
  81. overlay: {
  82. warnings: true,
  83. errors: false
  84. }
  85. },
  86. configureWebpack: {
  87. output: {
  88. sourcePrefix: " ",
  89. filename: `js/[name].${version}.js`,
  90. chunkFilename: `js/[name].${version}.js`
  91. },
  92. amd: {
  93. toUrlUndefined: true
  94. },
  95. resolve: {
  96. alias: {
  97. 'vue$': 'vue/dist/vue.esm.js',
  98. '@': path.resolve('src'),
  99. 'txml/txml': 'txml/dist/txml'
  100. // 'cesium': path.resolve(__dirname, cesiumSource)
  101. }
  102. },
  103. plugins: [
  104. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' }]),
  105. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' }]),
  106. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' }]),
  107. // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'ThirdParty/Workers'), to: 'ThirdParty/Workers' }]),
  108. // new webpack.DefinePlugin({
  109. // CESIUM_BASE_URL: JSON.stringify('./')
  110. // })
  111. ],
  112. module: {
  113. unknownContextCritical: /^.\/.*$/,
  114. unknownContextCritical: false
  115. }
  116. },
  117. // 给css添加版本号
  118. // chainWebpack: config => {
  119. // config.plugin('extract-css').tap(args => [
  120. // {
  121. // filename: `assets/css/[name].${version}.css`,
  122. // chunkFilename: `assets/css/[name].${version}.css`
  123. // }
  124. // ])
  125. // }
  126. }