index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. var path = require('path')
  3. module.exports = {
  4. build: {
  5. prodEnv: require('./prod.env'),
  6. index: path.resolve(__dirname, '../dist/index.html'),
  7. assetsRoot: path.resolve(__dirname, '../dist'),
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: './', //请根据自己路径配置更改
  10. productionSourceMap: false,
  11. // Gzip off by default as many popular static hosts such as
  12. // Surge or Netlify already gzip all static assets for you.
  13. // Before setting to `true`, make sure to:
  14. // npm install --save-dev compression-webpack-plugin
  15. productionGzip: false,
  16. productionGzipExtensions: ['js', 'css'],
  17. // Run the build command with an extra argument to
  18. // View the bundle analyzer report after build finishes:
  19. // `npm run build --report`
  20. // Set to `true` or `false` to always turn it on or off
  21. bundleAnalyzerReport: process.env.npm_config_report
  22. },
  23. dev: {
  24. host: 'localhost', // can be overwritten by process.env.HOST
  25. env: require('./dev.env'),
  26. port: 9527,
  27. autoOpenBrowser: true,
  28. assetsSubDirectory: 'static',
  29. assetsPublicPath: '/',
  30. proxyTable: {
  31. '/api': {
  32. // target: 'http://192.168.50.104:8083',
  33. // target: 'http://192.168.50.50:12002',
  34. // target: 'http://192.168.80.230:14100',
  35. // target: 'http://192.168.123.15:8098/api',
  36. //target: 'http://172.16.11.21:8097/api',//天津
  37. target:' http://101.36.160.210:31050',//陕西
  38. // target: 'http://192.168.40.174:13100',
  39. secure: false, // 如果是https接口,需要配置这个参数
  40. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  41. pathRewrite: {
  42. '^/api': ''
  43. },
  44. },
  45. '/loginApi': {
  46. // target: 'http://218.241.206.66:8097',
  47. // target: 'http://192.168.50.104:8002',
  48. // target: 'http://192.168.80.230:8097',
  49. // target: 'http://192.168.123.15:8098/api',
  50. target: 'http://172.16.11.21:8097',
  51. // target: 'http://192.168.123.15:13100',
  52. secure: false, //如果是https接口,需要配置这个参数
  53. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  54. pathRewrite: {
  55. '^/loginApi': ''
  56. },
  57. },
  58. '/main': {
  59. // target: 'http://192.168.50.104:8083',
  60. // target: 'http://192.168.123.15:11050',
  61. target: 'http://10.223.3.39:9090/api',//郭
  62. secure: false, // 如果是https接口,需要配置这个参数
  63. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  64. pathRewrite: {
  65. '^/main': ''
  66. },
  67. },
  68. '/uniteApi': { //统一线上api
  69. target: 'http://192.168.123.15:8098/api',
  70. // target: 'http://172.16.11.21:8097/api',
  71. secure: false, // 如果是https接口,需要配置这个参数
  72. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  73. pathRewrite: {
  74. '^/uniteApi': ''
  75. },
  76. },
  77. '/fileApi': {
  78. target: 'http://192.168.123.15:8098/api',
  79. secure: false, // 如果是https接口,需要配置这个参数
  80. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  81. pathRewrite: {
  82. '^/fileApi': ''
  83. },
  84. },
  85. '/submit': {
  86. target: 'http://172.16.11.21:8097/api',
  87. secure: false, // 如果是https接口,需要配置这个参数
  88. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  89. pathRewrite: {
  90. '^/submit': ''
  91. },
  92. },
  93. },
  94. // CSS Sourcemaps off by default because relative paths are "buggy"
  95. // with this option, according to the CSS-Loader README
  96. // (https://github.com/webpack/css-loader#sourcemaps)
  97. // In our experience, they generally work as expected,
  98. // just be aware of this issue when enabling this option.
  99. cssSourceMap: false
  100. }
  101. };