config.default.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import path from 'path';
  2. import { getBaseDir } from 'ee-core/ps';
  3. import type { Config } from 'ee-core';
  4. /**
  5. * 默认配置
  6. */
  7. export default (): Partial<Config> => {
  8. return {
  9. openDevTools: false,
  10. singleLock: true,
  11. windowsOption: {
  12. title: 'electron-egg',
  13. width: 1080,
  14. height: 780,
  15. minWidth: 1080,
  16. minHeight: 780,
  17. webPreferences: {
  18. //webSecurity: false,
  19. contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
  20. nodeIntegration: true,
  21. //preload: path.join(getElectronDir(), 'preload', 'bridge.js'),
  22. },
  23. frame: false,
  24. show: true,
  25. icon: path.join(getBaseDir(), 'public', 'images', 'logo-32.png'),
  26. },
  27. logger: {
  28. level: 'info', // 'fatal', 'error', 'warn', 'info', 'debug', 'trace' or 'silent'
  29. rotator: 'daily', // daily, hourly
  30. dateFormat: 'yyyy-MM-dd',
  31. maxSize: '100m',
  32. redact: [],
  33. redactCensor: '[Redacted]',
  34. timestamp: true,
  35. depthLimit: 5,
  36. timezone: 'Asia/Shanghai',
  37. name: 'ee',
  38. appLogName: 'ee.log',
  39. coreLogName: 'ee-core.log',
  40. errorLogName: 'ee-error.log'
  41. },
  42. mainServer: {
  43. protocol: 'file://',
  44. indexPath: '/public/dist/index.html',
  45. channelSeparator: '/',
  46. }
  47. }
  48. }