index.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. '/api': {
  12. target:"http://192.168.20.225:8080",//设置你调用的接口域名和端口号 别忘了加http
  13. changeOrigin: true,
  14. pathRewrite: {
  15. '^/api': '/' // 这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
  16. }
  17. },
  18. '/data-platform-3':{
  19. target:"http://101.200.32.13:28888",
  20. changeOrigin:true,
  21. pathRewrite:{
  22. '^/data-platform-3': '/'
  23. }
  24. },
  25. '/alarm-system':{
  26. target:"http://47.93.33.207:8889",
  27. changeOrigin:true,
  28. pathRewrite:{
  29. '^/alarm-system': '/'
  30. }
  31. },
  32. '/workorder':{
  33. target:"http://47.94.89.44:8081",
  34. changeOrigin:true,
  35. pathRewrite:{
  36. '^/workorder': '/'
  37. }
  38. },
  39. '/info-mng-backend': {
  40. target:"http://192.168.20.33:8080",//故障代理
  41. changeOrigin: true,
  42. pathRewrite: {
  43. '^/info-mng-backend': '/' // 这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
  44. }
  45. },
  46. '/image-service': {
  47. target:"http://service.sagacloud.cn:28888",
  48. changeOrigin:true,
  49. pathRewrite:{
  50. '^/image-service': '/'
  51. }
  52. }
  53. },
  54. // Various Dev Server settings
  55. host: 'localhost', // can be overwritten by process.env.HOST
  56. disableHostCheck: true,
  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. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  62. // Use Eslint Loader?
  63. // If true, your code will be linted during bundling and
  64. // linting errors and warnings will be shown in the console.
  65. useEslint: false,
  66. // If true, eslint errors and warnings will also be shown in the error overlay
  67. // in the browser.
  68. showEslintErrorsInOverlay: false,
  69. /**
  70. * Source Maps
  71. */
  72. // https://webpack.js.org/configuration/devtool/#development
  73. devtool: 'cheap-module-eval-source-map',
  74. // If you have problems debugging vue-files in devtools,
  75. // set this to false - it *may* help
  76. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  77. cacheBusting: true,
  78. cssSourceMap: true
  79. },
  80. build: {
  81. // Template for index.html
  82. index: path.resolve(__dirname, '../dist/index.html'),
  83. // Paths
  84. assetsRoot: path.resolve(__dirname, '../dist'),
  85. assetsSubDirectory: 'static',
  86. assetsPublicPath: '/',
  87. /**
  88. * Source Maps
  89. */
  90. productionSourceMap: true,
  91. // https://webpack.js.org/configuration/devtool/#production
  92. devtool: '#source-map',
  93. // Gzip off by default as many popular static hosts such as
  94. // Surge or Netlify already gzip all static assets for you.
  95. // Before setting to `true`, make sure to:
  96. // npm install --save-dev compression-webpack-plugin
  97. productionGzip: false,
  98. productionGzipExtensions: ['js', 'css'],
  99. // Run the build command with an extra argument to
  100. // View the bundle analyzer report after build finishes:
  101. // `npm run build --report`
  102. // Set to `true` or `false` to always turn it on or off
  103. bundleAnalyzerReport: process.env.npm_config_report
  104. }
  105. }