index.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 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: true, // 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. allowedHosts: "all",
  63. disableHostCheck: false,
  64. /**
  65. * Source Maps
  66. */
  67. // https://webpack.js.org/configuration/devtool/#development
  68. devtool: 'cheap-module-eval-source-map',
  69. // If you have problems debugging vue-files in devtools,
  70. // set this to false - it *may* help
  71. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  72. cacheBusting: true,
  73. cssSourceMap: true
  74. },
  75. build: {
  76. // Template for index.html
  77. index: path.resolve(__dirname, '../../src/main/resources/static/index.html'),
  78. user: path.resolve(__dirname, '../../src/main/resources/static/index.html'),
  79. // Paths
  80. assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'),
  81. assetsSubDirectory: './static',
  82. assetsPublicPath: '/',
  83. /**
  84. * Source Maps
  85. */
  86. productionSourceMap: true,
  87. // https://webpack.js.org/configuration/devtool/#production
  88. devtool: '#source-map',
  89. // Gzip off by default as many popular static hosts such as
  90. // Surge or Netlify already gzip all static assets for you.
  91. // Before setting to `true`, make sure to:
  92. // npm install --save-dev compression-webpack-plugin
  93. productionGzip: false,
  94. productionGzipExtensions: ['js', 'css'],
  95. // Run the build command with an extra argument to
  96. // View the bundle analyzer report after build finishes:
  97. // `npm run build --report`
  98. // Set to `true` or `false` to always turn it on or off
  99. bundleAnalyzerReport: process.env.npm_config_report
  100. }
  101. }