index.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // secure:false, // 如果是https接口,需要配置这个参数
  41. changeOrigin:true, // 如果接口跨域,需要进行这个参数配置
  42. pathRewrite:{
  43. '^/adminapi':'/adminapi'
  44. },
  45. }
  46. },
  47. // CSS Sourcemaps off by default because relative paths are "buggy"
  48. // with this option, according to the CSS-Loader README
  49. // (https://github.com/webpack/css-loader#sourcemaps)
  50. // In our experience, they generally work as expected,
  51. // just be aware of this issue when enabling this option.
  52. cssSourceMap: false
  53. },
  54. test: {
  55. env: !isPreProduction ? require('./prod.test.env') : require('./prod.pre.env'),
  56. index: !isPreProduction ? path.resolve(__dirname, '../hz_crm_web/index.html') : path.resolve(__dirname, '../testadmin/index.html') ,
  57. assetsRoot: !isPreProduction ? path.resolve(__dirname, '../hz_crm_web') : path.resolve(__dirname, '../testadmin'),
  58. assetsSubDirectory: 'static',
  59. // assetsPublicPath: '/vue-admin/',
  60. assetsPublicPath: './',
  61. productionSourceMap: false,
  62. // Gzip off by default as many popular static hosts such as
  63. // Surge or Netlify already gzip all static assets for you.
  64. // Before setting to `true`, make sure to:
  65. // npm install --save-dev compression-webpack-plugin
  66. productionGzip: true,
  67. productionGzipExtensions: ['js', 'css'],
  68. // Run the build command with an extra argument to
  69. // View the bundle analyzer report after build finishes:
  70. // `npm run build --report`
  71. // Set to `true` or `false` to always turn it on or off
  72. bundleAnalyzerReport: process.env.npm_config_report
  73. }
  74. }