index.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. 'use strict'
  2. // Template version: 1.1.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. let project = "gezhouba";
  6. const devServer = require('./dev/' + project + '.js'); //服务信息
  7. module.exports = {
  8. project: "", //打包需要使用(sass-loader)
  9. build: {
  10. env: require('./prod.env'),
  11. index: path.resolve(__dirname, '../dist/index.html'),
  12. assetsRoot: path.resolve(__dirname, '../dist'),
  13. assetsSubDirectory: 'static',
  14. assetsPublicPath: './',
  15. productionSourceMap: true,
  16. // Gzip off by default as many popular static hosts such as
  17. // Surge or Netlify already gzip all static assets for you.
  18. // Before setting to `true`, make sure to:
  19. // npm install --save-dev compression-webpack-plugin
  20. productionGzip: false,
  21. productionGzipExtensions: ['js', 'css'],
  22. // Run the build command with an extra argument to
  23. // View the bundle analyzer report after build finishes:
  24. // `npm run build --report`
  25. // Set to `true` or `false` to always turn it on or off
  26. bundleAnalyzerReport: process.env.npm_config_report
  27. },
  28. dev: {
  29. env: require('./dev.env'),
  30. port: process.env.PORT || 8085,
  31. autoOpenBrowser: true,
  32. assetsSubDirectory: 'static',
  33. assetsPublicPath: '/',
  34. proxyTable: {
  35. "/landcrm": { //基础服务
  36. target: "https://test.hajwy.com/landcrm",
  37. secure: false,
  38. changeOrigin: true,
  39. pathRewrite: {
  40. '^/landcrm': '/'
  41. }
  42. },
  43. "/mkf": { //地区、项目获取
  44. target: 'https://test.hajwy.com/landcrm',
  45. secure: false,
  46. changeOrigin: true,
  47. pathRewrite: {
  48. '^/mkf': '/'
  49. }
  50. },
  51. "/hajwy": { //采购结算明细对接
  52. target: 'https://test.hajwy.com/qpi/rest',
  53. secure: false,
  54. changeOrigin: true,
  55. pathRewrite: {
  56. '^/hajwy': '/'
  57. }
  58. },
  59. "/purchase": { //采采购管理整体测试
  60. // target: "http://www.jihengcc.cn:17080/purchase", //采购供应商管理测试
  61. target: "https://test.hajwy.com/purchase", //采购供应商管理测试
  62. // target: "http://172.18.1.40:8989/purchase",
  63. secure: false,
  64. changeOrigin: true,
  65. pathRewrite: {
  66. '^/purchase': '/'
  67. }
  68. }
  69. },
  70. // CSS Sourcemaps off by default because relative paths are "buggy"
  71. // with this option, according to the CSS-Loader README
  72. // (https://github.com/webpack/css-loader#sourcemaps)
  73. // In our experience, they generally work as expected,
  74. // just be aware of this issue when enabling this option.
  75. cssSourceMap: false
  76. }
  77. }