index.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: '/',
  9. assetsPublicPath: '/',
  10. proxyTable: {
  11. '/api': {
  12. target:"http://192.168.20.225:8080",//设置你调用的接口域名和端口号 别忘了加http
  13. changeOrigin: true,
  14. },
  15. '/data-platform-3':{
  16. target:"http://api.sagacloud.cn/",
  17. changeOrigin:true
  18. },
  19. '/info-mng-backend': {
  20. target:" http://hyy.sagacloud.cn",//故障代理
  21. changeOrigin: true,
  22. },
  23. '/dp-auxiliary':{
  24. target:"http://api.sagacloud.cn/",
  25. changeOrigin:true
  26. },
  27. '/fm-service':{
  28. target:"http://api.sagacloud.cn/",
  29. changeOrigin:true
  30. },
  31. },
  32. // Various Dev Server settings
  33. host: 'localhost', // can be overwritten by process.env.HOST
  34. disableHostCheck: true,
  35. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  36. autoOpenBrowser: false,
  37. errorOverlay: true,
  38. notifyOnErrors: true,
  39. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  40. // Use Eslint Loader?
  41. // If true, your code will be linted during bundling and
  42. // linting errors and warnings will be shown in the console.
  43. useEslint: false,
  44. // If true, eslint errors and warnings will also be shown in the error overlay
  45. // in the browser.
  46. showEslintErrorsInOverlay: false,
  47. /**
  48. * Source Maps
  49. */
  50. // https://webpack.js.org/configuration/devtool/#development
  51. devtool: 'cheap-module-eval-source-map',
  52. // If you have problems debugging vue-files in devtools,
  53. // set this to false - it *may* help
  54. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  55. cacheBusting: true,
  56. cssSourceMap: true
  57. },
  58. build: {
  59. // Template for index.html
  60. index: path.resolve(__dirname, '../dist/hyy-alarm/index.html'),
  61. // Paths
  62. assetsRoot: path.resolve(__dirname, '../dist'),
  63. assetsSubDirectory: '/static',
  64. assetsPublicPath: '/',
  65. staticPath: './', //生产环境 staticPath:''
  66. /**
  67. * Source Maps
  68. */
  69. productionSourceMap: true,
  70. // https://webpack.js.org/configuration/devtool/#production
  71. devtool: '#source-map',
  72. // Gzip off by default as many popular static hosts such as
  73. // Surge or Netlify already gzip all static assets for you.
  74. // Before setting to `true`, make sure to:
  75. // npm install --save-dev compression-webpack-plugin
  76. productionGzip: false,
  77. productionGzipExtensions: ['js', 'css'],
  78. // Run the build command with an extra argument to
  79. // View the bundle analyzer report after build finishes:
  80. // `npm run build --report`
  81. // Set to `true` or `false` to always turn it on or off
  82. bundleAnalyzerReport: process.env.npm_config_report
  83. }
  84. }