index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.1.52:8002', // 翟毅飞
  13. // target: 'http://192.168.1.77:8002', //曹世祥本地服务
  14. // target: 'http://192.168.1.20:8000', // 范玉虎本地服务
  15. // target: 'http://47.104.218.216:8001', //曹世祥线上服务
  16. // target: 'http://192.168.1.76:8000', //杨明明本地服务
  17. // target: 'http://192.168.1.102:8003', //孙加可本地服务
  18. // target: 'http://192.168.1.168:8000', //闫自林本地服务
  19. // target: 'http://114.115.147.140:8002',
  20. // target: 'http://8.136.98.49:8002', // 线上服务
  21. // target: 'http://hnyfwlw.com:8002', //线上服务
  22. // target: 'http://114.115.147.140:8002', // 线上服务
  23. target: 'http://111.43.116.162:8002', // 线上服务
  24. // target: 'https://web.hnyfwlw.com:58002', //线上服务
  25. changeOrigin: true,
  26. pathRewrite: {
  27. '^/api': '/api' // 重写接口
  28. }
  29. },
  30. '/shuLianApi': {
  31. target: 'http://8.136.98.49:58008', // 数联预警
  32. changeOrigin: true,
  33. pathRewrite: {
  34. '^/shuLianApi': '/api' // 重写接口
  35. }
  36. },
  37. '/search': {
  38. target: 'http://www.yfzhwlw.com', // 线上服务
  39. changeOrigin: true,
  40. pathRewrite: {
  41. '^/search': '/search' // 重写接口
  42. }
  43. }
  44. },
  45. // Various Dev Server settings
  46. host: '0.0.0.0', // can be overwritten by process.env.HOST
  47. port: 8003, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  48. // autoOpenBrowser: false,
  49. autoOpenBrowser: true,
  50. errorOverlay: true,
  51. notifyOnErrors: true,
  52. poll: false, // https://webpack.sjs.org/configuration/dev-server/#devserver-watchoptions-
  53. // Use Eslint Loader?
  54. // If true, your code will be linted during bundling and
  55. // linting errors and warnings will be shown in the console.
  56. useEslint: true,
  57. // If true, eslint errors and warnings will also be shown in the error overlay
  58. // in the browser.
  59. showEslintErrorsInOverlay: false,
  60. /**
  61. * Source Maps
  62. */
  63. // https://webpack.js.org/configuration/devtool/#development
  64. devtool: 'cheap-module-eval-source-map',
  65. // If you have problems debugging vue-files in devtools,
  66. // set this to false - it *may* help
  67. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  68. cacheBusting: true,
  69. cssSourceMap: true
  70. },
  71. build: {
  72. // Template for index.html
  73. index: path.resolve(__dirname, '../dist/index.html'),
  74. // Paths
  75. assetsRoot: path.resolve(__dirname, '../dist'),
  76. assetsSubDirectory: 'static',
  77. assetsPublicPath: '/',
  78. /**
  79. * Source Maps
  80. */
  81. productionSourceMap: false,
  82. // https://webpack.js.org/configuration/devtool/#production
  83. devtool: '#source-map',
  84. // Gzip off by default as many popular static hosts such as
  85. // Surge or Netlify already gzip all static assets for you.
  86. // Before setting to `true`, make sure to:
  87. // npm install --save-dev compression-webpack-plugin
  88. productionGzip: true,
  89. productionGzipExtensions: ['js', 'css'],
  90. // Run the build command with an extra argument to
  91. // View the bundle analyzer report after build finishes:
  92. // `npm run build --report`
  93. // Set to `true` or `false` to always turn it on or off
  94. bundleAnalyzerReport: process.env.npm_config_report
  95. }
  96. };