bin.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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'],
  24. loadingPage: '/public/html/loading.html',
  25. }
  26. },
  27. /**
  28. * 构建
  29. * ee-bin build
  30. */
  31. build: {
  32. frontend: {
  33. directory: './frontend',
  34. cmd: 'npm',
  35. args: ['run', 'build'],
  36. }
  37. },
  38. /**
  39. * 移动资源
  40. * ee-bin move
  41. */
  42. move: {
  43. frontend_dist: {
  44. dist: './frontend/dist',
  45. target: './public/dist'
  46. }
  47. },
  48. /**
  49. * 预发布模式(prod)
  50. * ee-bin start
  51. */
  52. start: {
  53. directory: './',
  54. cmd: 'electron',
  55. args: ['.', '--env=prod']
  56. },
  57. /**
  58. * 加密
  59. */
  60. encrypt: {
  61. type: 'confusion',
  62. files: [
  63. 'electron/**/*.(js|json)',
  64. '!electron/config/encrypt.js',
  65. '!electron/config/nodemon.json',
  66. '!electron/config/builder.json',
  67. '!electron/config/bin.json',
  68. ],
  69. fileExt: ['.js'],
  70. confusionOptions: {
  71. compact: true,
  72. stringArray: true,
  73. stringArrayEncoding: ['none'],
  74. deadCodeInjection: false,
  75. }
  76. },
  77. /**
  78. * 执行自定义命令
  79. * ee-bin exec
  80. */
  81. exec: {
  82. node_v: {
  83. directory: './',
  84. cmd: 'node',
  85. args: ['-v'],
  86. },
  87. npm_v: {
  88. directory: './',
  89. cmd: 'npm',
  90. args: ['-v'],
  91. },
  92. },
  93. };