index.js 3.1 KB

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