index.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. var path = require('path')
  3. var argv = process.argv.slice(2);
  4. var isPreProduction = argv.indexOf('preProduction') !== -1;
  5. console.log(argv,isPreProduction);
  6. module.exports = {
  7. build: {
  8. env: require('./prod.env'),
  9. index: path.resolve(__dirname, '../hz_crm_web/index.html'),
  10. assetsRoot: path.resolve(__dirname, '../hz_crm_web'),
  11. assetsSubDirectory: 'static',
  12. // assetsPublicPath: '/vue-admin/',
  13. assetsPublicPath: './',
  14. productionSourceMap: false,
  15. // Gzip off by default as many popular static hosts such as
  16. // Surge or Netlify already gzip all static assets for you.
  17. // Before setting to `true`, make sure to:
  18. // npm install --save-dev compression-webpack-plugin
  19. productionGzip: true,
  20. productionGzipExtensions: ['js', 'css'],
  21. // Run the build command with an extra argument to
  22. // View the bundle analyzer report after build finishes:
  23. // `npm run build --report`
  24. // Set to `true` or `false` to always turn it on or off
  25. bundleAnalyzerReport: process.env.npm_config_report
  26. },
  27. dev: {
  28. // 原始配置
  29. env: require('./dev.env'),
  30. host: 'newadmin.brilliantstart.cn', // can be overwritten by process.env.HOST
  31. port: 7777,
  32. autoOpenBrowser: false,
  33. assetsSubDirectory: 'static',
  34. assetsPublicPath: '/',
  35. proxyTable:{
  36. '/adminapi': {
  37. // target:'http://rddpapi.brilliantstart.cn', // 接口的域名
  38. // target:'https://admin.hzinsights.com', // 接口的域名
  39. target:'http://8.136.199.33:7777', // 接口的域名
  40. // target:'http://192.168.77.7:8602', // 接口的域名
  41. // secure:false, // 如果是https接口,需要配置这个参数
  42. changeOrigin:true, // 如果接口跨域,需要进行这个参数配置
  43. pathRewrite:{
  44. '^/adminapi':'/adminapi'
  45. },
  46. }
  47. },
  48. // CSS Sourcemaps off by default because relative paths are "buggy"
  49. // with this option, according to the CSS-Loader README
  50. // (https://github.com/webpack/css-loader#sourcemaps)
  51. // In our experience, they generally work as expected,
  52. // just be aware of this issue when enabling this option.
  53. cssSourceMap: false
  54. },
  55. test: {
  56. env: !isPreProduction ? require('./prod.test.env') : require('./prod.pre.env'),
  57. index: !isPreProduction ? path.resolve(__dirname, '../hz_crm_web/index.html') : path.resolve(__dirname, '../testadmin/index.html') ,
  58. assetsRoot: !isPreProduction ? path.resolve(__dirname, '../hz_crm_web') : path.resolve(__dirname, '../testadmin'),
  59. assetsSubDirectory: 'static',
  60. // assetsPublicPath: '/vue-admin/',
  61. assetsPublicPath: './',
  62. productionSourceMap: false,
  63. // Gzip off by default as many popular static hosts such as
  64. // Surge or Netlify already gzip all static assets for you.
  65. // Before setting to `true`, make sure to:
  66. // npm install --save-dev compression-webpack-plugin
  67. productionGzip: true,
  68. productionGzipExtensions: ['js', 'css'],
  69. // Run the build command with an extra argument to
  70. // View the bundle analyzer report after build finishes:
  71. // `npm run build --report`
  72. // Set to `true` or `false` to always turn it on or off
  73. bundleAnalyzerReport: process.env.npm_config_report
  74. }
  75. }