index.js 3.0 KB

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