bin.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * ee-bin 配置
  3. * 仅适用于开发环境
  4. */
  5. module.exports = {
  6. /**
  7. * development serve ("frontend" "electron" )
  8. * ee-bin dev
  9. */
  10. dev: {
  11. frontend: {
  12. directory: './frontend',
  13. cmd: 'npm',
  14. args: ['run', 'dev'],
  15. protocol: 'http://',
  16. hostname: 'localhost',
  17. port: 8080,
  18. indexPath: 'index.html'
  19. },
  20. electron: {
  21. directory: './',
  22. cmd: 'electron',
  23. args: ['.', '--env=local', '--color=always'],
  24. }
  25. },
  26. /**
  27. * 构建
  28. * ee-bin build
  29. */
  30. build: {
  31. frontend: {
  32. directory: './frontend',
  33. cmd: 'npm',
  34. args: ['run', 'build'],
  35. }
  36. },
  37. /**
  38. * 移动资源
  39. * ee-bin move
  40. */
  41. move: {
  42. frontend_dist: {
  43. dist: './frontend/dist',
  44. target: './public/dist'
  45. }
  46. },
  47. /**
  48. * 预发布模式(prod)
  49. * ee-bin start
  50. */
  51. start: {
  52. directory: './',
  53. cmd: 'electron',
  54. args: ['.', '--env=prod']
  55. },
  56. /**
  57. * 加密
  58. */
  59. encrypt: {
  60. type: 'confusion',
  61. files: [
  62. 'electron/**/*.(js|json)',
  63. '!electron/config/encrypt.js',
  64. '!electron/config/nodemon.json',
  65. '!electron/config/builder.json',
  66. '!electron/config/bin.json',
  67. ],
  68. fileExt: ['.js'],
  69. confusionOptions: {
  70. compact: true,
  71. stringArray: true,
  72. stringArrayEncoding: ['none'],
  73. deadCodeInjection: false,
  74. }
  75. },
  76. /**
  77. * 执行自定义命令
  78. * ee-bin exec
  79. */
  80. exec: {
  81. node_v: {
  82. directory: './',
  83. cmd: 'node',
  84. args: ['-v'],
  85. },
  86. npm_v: {
  87. directory: './',
  88. cmd: 'npm',
  89. args: ['-v'],
  90. },
  91. python: {
  92. directory: './python',
  93. cmd: 'python',
  94. args: ['./index.py', '--port=7074'],
  95. stdio: "inherit", // ignore
  96. },
  97. },
  98. };