Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

112 Zeilen
3.6 KiB

  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. module.exports = {
  6. dev: {
  7. // Paths
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: '/',
  10. proxyTable: {
  11. // '/wms': {
  12. // target: 'https://xiaobu.zhaobu.wang',
  13. // ws: true,
  14. // changeOrigin: true
  15. // }
  16. '/api': {
  17. // target: 'http://192.168.1.25:8080', // tong wanghao
  18. // target: 'http://192.168.1.31:8080',
  19. target: 'http://hfxny.mes.picaiba.com',
  20. // target: 'http://192.168.1.49:8080', // tong wanghao
  21. // target: 'http://192.168.1.67:8080',
  22. // target: 'http://192.168.0.165:8080',
  23. // target: 'http://192.168.43.105:8080',
  24. // target: 'http://127.0.0.1:8080',
  25. // target: 'http://192.168.0.70:8080',
  26. // target: 'http://192.168.0.199:8080',
  27. ws: true,
  28. changeOrigin: true,
  29. pathRewrite: {
  30. '^/portapi': ''
  31. }
  32. // 使用了proxy 就需要开启下面的选项 (http-proxy-middleware会将post请求给parse了 所以需要再次进行string化)
  33. // onProxyReq: (proxyReq, req, res, options) => {
  34. // if (req.body) {
  35. // const bodyData = JSON.stringify(req.body)
  36. // // incase if content-type is application/x-www-form-urlencoded -> we need to change to application/json
  37. // proxyReq.setHeader('Content-Type', 'application/json')
  38. // proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData))
  39. // // stream the content
  40. // proxyReq.write(bodyData)
  41. // }
  42. // }
  43. },
  44. },
  45. // Various Dev Server settings
  46. host: '0.0.0.0', // can be overwritten by process.env.HOST
  47. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  48. autoOpenBrowser: false,
  49. errorOverlay: true,
  50. notifyOnErrors: true,
  51. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  52. // Use Eslint Loader?
  53. // If true, your code will be linted during bundling and
  54. // linting errors and warnings will be shown in the console.
  55. useEslint: true,
  56. // If true, eslint errors and warnings will also be shown in the error overlay
  57. // in the browser.
  58. showEslintErrorsInOverlay: false,
  59. /**
  60. * Source Maps
  61. */
  62. // https://webpack.js.org/configuration/devtool/#development
  63. devtool: 'cheap-module-eval-source-map',
  64. // If you have problems debugging vue-files in devtools,
  65. // set this to false - it *may* help
  66. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  67. cacheBusting: true,
  68. cssSourceMap: true
  69. },
  70. build: {
  71. // Template for index.html
  72. index: path.resolve(__dirname, '../dist/index.html'),
  73. // Paths
  74. assetsRoot: path.resolve(__dirname, '../dist'),
  75. assetsSubDirectory: 'static',
  76. assetsPublicPath: './',
  77. /**
  78. * Source Maps
  79. */
  80. productionSourceMap: true,
  81. // https://webpack.js.org/configuration/devtool/#production
  82. devtool: '#source-map',
  83. // Gzip off by default as many popular static hosts such as
  84. // Surge or Netlify already gzip all static assets for you.
  85. // Before setting to `true`, make sure to:
  86. // npm install --save-dev compression-webpack-plugin
  87. productionGzip: false,
  88. productionGzipExtensions: ['js', 'css'],
  89. // Run the build command with an extra argument to
  90. // View the bundle analyzer report after build finishes:
  91. // `npm run build --report`
  92. // Set to `true` or `false` to always turn it on or off
  93. bundleAnalyzerReport: process.env.npm_config_report
  94. }
  95. }