index.js 2.0 KB

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