index.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. var path = require('path')
  2. // var ip = '127.0.0.1'
  3. // var ip = '192.168.2.9'
  4. var ip = '192.168.2.30'
  5. // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
  6. // for (var i in ifaces) {
  7. // for (var j in ifaces[i]) {
  8. // var val = ifaces[i][j]
  9. // if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
  10. // ip = val.address
  11. // }
  12. // }
  13. // }
  14. module.exports = {
  15. build: {
  16. env: require('./prod.env'),
  17. index: path.resolve(__dirname, '../dist/index.html'),
  18. assetsRoot: path.resolve(__dirname, '../dist'),
  19. assetsSubDirectory: 'static',
  20. assetsPublicPath: './',
  21. productionSourceMap: false,
  22. productionGzip: false,
  23. productionGzipExtensions: ['js', 'css'],
  24. bundleAnalyzerReport: process.env.npm_config_report
  25. },
  26. dev: {
  27. env: require('./dev.env'),
  28. port: 10086,
  29. autoOpenBrowser: true,
  30. assetsSubDirectory: 'static',
  31. assetsPublicPath: '/',
  32. proxyTable: {
  33. // '/api/permission': {
  34. // target: 'http://' + ip + ':2022',
  35. // pathRewrite: {'^api': '/'}
  36. // },
  37. // '/api/user': {
  38. // target: 'http://' + ip + ':10010',
  39. // pathRewrite: {'^api': '/'}
  40. // }
  41. // '/api/permission': {
  42. // target: 'http://'+ ip +':2022',
  43. // secure: true,
  44. // changeOrigin: true,
  45. // pathRewrite: {
  46. // '^/api': '/'
  47. // }
  48. // },
  49. '/api': {
  50. target: 'http://'+ ip +':10010',
  51. secure: true,
  52. changeOrigin: true,
  53. pathRewrite: {
  54. '^/api': '/'
  55. }
  56. },
  57. // '/ips': {
  58. // target: 'http://'+ ip +':8080',
  59. // secure: true,
  60. // changeOrigin: true,
  61. // pathRewrite: {
  62. // '^/ips': '/'
  63. // }
  64. // },
  65. },
  66. cssSourceMap: false
  67. }
  68. }