index.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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://101.36.160.140:8097/api',
  33. target: 'http://101.36.160.140:21025/api',
  34. secure: false, // 如果是https接口,需要配置这个参数
  35. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  36. pathRewrite: {
  37. '^/api': ''
  38. },
  39. },
  40. '/loginApi': {
  41. // target: 'http://101.36.160.140:8097',
  42. target: 'http://101.36.160.140:21025',
  43. secure: false, //如果是https接口,需要配置这个参数
  44. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  45. pathRewrite: {
  46. '^/loginApi': ''
  47. },
  48. },
  49. '/main': {
  50. target: 'http://192.168.40.174:13100',//郭
  51. secure: false, // 如果是https接口,需要配置这个参数
  52. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  53. pathRewrite: {
  54. '^/main': ''
  55. },
  56. },
  57. '/uniteApi': { //统一线上api
  58. target: 'http://192.168.123.15:8098/api',
  59. // target: 'http://101.36.160.140:8097/api',
  60. secure: false, // 如果是https接口,需要配置这个参数
  61. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  62. pathRewrite: {
  63. '^/uniteApi': ''
  64. },
  65. },
  66. '/fileApi': {
  67. target: 'http://192.168.123.15:8098/api',
  68. secure: false, // 如果是https接口,需要配置这个参数
  69. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  70. pathRewrite: {
  71. '^/fileApi': ''
  72. },
  73. },
  74. '/submit': {
  75. target: 'http://101.36.160.140:21025/api',
  76. secure: false, // 如果是https接口,需要配置这个参数
  77. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  78. pathRewrite: {
  79. '^/submit': ''
  80. },
  81. },
  82. },
  83. // CSS Sourcemaps off by default because relative paths are "buggy"
  84. // with this option, according to the CSS-Loader README
  85. // (https://github.com/webpack/css-loader#sourcemaps)
  86. // In our experience, they generally work as expected,
  87. // just be aware of this issue when enabling this option.
  88. cssSourceMap: false
  89. }
  90. };