index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. 'use strict'
  2. // Template version: 1.3.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. const baseUrl = "https://192.168.31.250:29001"
  6. const ZLMServer = "https://kindring.cn:29010"
  7. module.exports = {
  8. dev: {
  9. // Paths
  10. assetsSubDirectory: 'static',
  11. assetsPublicPath: '/',
  12. proxyTable: {
  13. '/debug': {
  14. target: baseUrl,
  15. changeOrigin: true,
  16. secure: false,
  17. pathRewrite: {
  18. '^/debug': ''
  19. },headers: {
  20. Referer: baseUrl
  21. }
  22. },
  23. '/zlmServer': {
  24. target: ZLMServer,
  25. changeOrigin: true,
  26. secure: false,
  27. pathRewrite: {
  28. '^/zlmServer': ''
  29. },headers: {
  30. Referer: baseUrl
  31. }
  32. },
  33. '/debug/zlmServer': {
  34. target: ZLMServer,
  35. changeOrigin: true,
  36. secure: false,
  37. pathRewrite: {
  38. '^/debug/zlmServer': ''
  39. },headers: {
  40. Referer: baseUrl
  41. }
  42. },
  43. '/aiLib':{
  44. target: baseUrl,
  45. secure: false,
  46. changeOrigin: true,
  47. },
  48. '/mFile':{
  49. target: baseUrl,
  50. secure: false,
  51. changeOrigin: true,
  52. },
  53. '/static/snap': {
  54. target: baseUrl,
  55. secure: false,
  56. changeOrigin: true,
  57. // pathRewrite: {
  58. // '^/static/snap': '/static/snap'
  59. // }
  60. },
  61. },
  62. devServer: {
  63. https: true,
  64. },
  65. // Various Dev Server settings
  66. host:"0.0.0.0",
  67. useLocalIp: false, // can be overwritten by process.env.HOST
  68. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  69. autoOpenBrowser: false,
  70. errorOverlay: true,
  71. notifyOnErrors: true,
  72. hot: true,//自动保存
  73. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  74. /**
  75. * Source Maps
  76. */
  77. // https://webpack.js.org/configuration/devtool/#development
  78. devtool: 'cheap-module-eval-source-map',
  79. // If you have problems debugging vue-files in devtools,
  80. // set this to false - it *may* help
  81. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  82. cacheBusting: true,
  83. cssSourceMap: true
  84. },
  85. build: {
  86. // Template for index.html
  87. index: path.resolve(__dirname, '../../src/main/resources/static/index.html'),
  88. user: path.resolve(__dirname, '../../src/main/resources/static/index.html'),
  89. // Paths
  90. assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'),
  91. assetsSubDirectory: './static',
  92. assetsPublicPath: '/',
  93. /**
  94. * Source Maps
  95. */
  96. productionSourceMap: true,
  97. // https://webpack.js.org/configuration/devtool/#production
  98. devtool: '#source-map',
  99. // Gzip off by default as many popular static hosts such as
  100. // Surge or Netlify already gzip all static assets for you.
  101. // Before setting to `true`, make sure to:
  102. // npm install --save-dev compression-webpack-plugin
  103. productionGzip: false,
  104. productionGzipExtensions: ['js', 'css'],
  105. // Run the build command with an extra argument to
  106. // View the bundle analyzer report after build finishes:
  107. // `npm run build --report`
  108. // Set to `true` or `false` to always turn it on or off
  109. bundleAnalyzerReport: process.env.npm_config_report
  110. }
  111. }