index.js 2.0 KB

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