bin.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. python: {
  37. directory: "./python",
  38. cmd: "python",
  39. args: ["./setup.py", "build"],
  40. },
  41. },
  42. /**
  43. * 移动资源
  44. * ee-bin move
  45. */
  46. move: {
  47. frontend_dist: {
  48. dist: "./frontend/dist",
  49. target: "./public/dist",
  50. },
  51. python_dist: {
  52. dist: "./python/dist",
  53. target: "./build/extraResources/py",
  54. },
  55. },
  56. /**
  57. * 预发布模式(prod)
  58. * ee-bin start
  59. */
  60. start: {
  61. directory: "./",
  62. cmd: "electron",
  63. args: [".", "--env=prod"],
  64. },
  65. /**
  66. * 加密
  67. */
  68. encrypt: {
  69. type: "confusion",
  70. files: [
  71. "electron/**/*.(js|json)",
  72. "!electron/config/encrypt.js",
  73. "!electron/config/nodemon.json",
  74. "!electron/config/builder.json",
  75. "!electron/config/bin.json",
  76. ],
  77. fileExt: [".js"],
  78. confusionOptions: {
  79. compact: true,
  80. stringArray: true,
  81. stringArrayEncoding: ["none"],
  82. deadCodeInjection: false,
  83. },
  84. },
  85. /**
  86. * 执行自定义命令
  87. * ee-bin exec
  88. */
  89. exec: {
  90. node_v: {
  91. directory: "./",
  92. cmd: "node",
  93. args: ["-v"],
  94. },
  95. npm_v: {
  96. directory: "./",
  97. cmd: "npm",
  98. args: ["-v"],
  99. },
  100. python: {
  101. directory: "./python",
  102. cmd: ".venv/Scripts/python",
  103. args: ["./main.py", "--port=7074"],
  104. stdio: "inherit", // ignore
  105. },
  106. },
  107. };