forge.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const { FusesPlugin } = require('@electron-forge/plugin-fuses');
  2. const { FuseV1Options, FuseVersion } = require('@electron/fuses');
  3. module.exports = {
  4. packagerConfig: {
  5. asar: true,
  6. },
  7. rebuildConfig: {},
  8. makers: [
  9. {
  10. name: '@electron-forge/maker-squirrel',
  11. platforms: ['win32'],
  12. config: {
  13. name: 'electron-vue',
  14. },
  15. },
  16. {
  17. name: '@electron-forge/maker-zip',
  18. platforms: ['darwin'],
  19. },
  20. // {
  21. // name: '@electron-forge/maker-deb',
  22. // config: {},
  23. // },
  24. // {
  25. // name: '@electron-forge/maker-rpm',
  26. // config: {},
  27. // },
  28. ],
  29. plugins: [
  30. {
  31. name: '@electron-forge/plugin-auto-unpack-natives',
  32. config: {},
  33. },
  34. // Fuses 用于启用/禁用各种Electron功能
  35. // 在打包时,在对应用程序进行代码签名之前
  36. new FusesPlugin({
  37. version: FuseVersion.V1,
  38. [FuseV1Options.RunAsNode]: false,
  39. [FuseV1Options.EnableCookieEncryption]: true,
  40. [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
  41. [FuseV1Options.EnableNodeCliInspectArguments]: false,
  42. [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
  43. [FuseV1Options.OnlyLoadAppFromAsar]: true,
  44. }),
  45. ],
  46. };