config.default.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import path from 'path';
  2. import { getBaseDir } from 'ee-core/ps';
  3. import type { Config } from 'ee-core';
  4. import { sharedWebPreferences } from './windowOptions';
  5. /**
  6. * 默认配置
  7. */
  8. export default (): Partial<Config> => {
  9. return {
  10. openDevTools: false,
  11. singleLock: true,
  12. windowsOption: {
  13. title: 'electron-egg',
  14. width: 1280,
  15. height: 860,
  16. minWidth: 1280,
  17. minHeight: 860,
  18. webPreferences: {
  19. //webSecurity: false,
  20. // 与智能工作台窗口共用同一份配置(见 windowOptions.ts),避免两窗口行为漂移
  21. ...sharedWebPreferences,
  22. //preload: path.join(getElectronDir(), 'preload', 'bridge.js'),
  23. },
  24. frame: false,
  25. show: true,
  26. icon: path.join(getBaseDir(), 'public', 'images', 'logo-32.png'),
  27. },
  28. logger: {
  29. level: 'info', // 'fatal', 'error', 'warn', 'info', 'debug', 'trace' or 'silent'
  30. rotator: 'daily', // daily, hourly
  31. dateFormat: 'yyyy-MM-dd',
  32. maxSize: '100m',
  33. redact: [],
  34. redactCensor: '[Redacted]',
  35. timestamp: true,
  36. depthLimit: 5,
  37. timezone: 'Asia/Shanghai',
  38. name: 'ee',
  39. appLogName: 'ee.log',
  40. coreLogName: 'ee-core.log',
  41. errorLogName: 'ee-error.log'
  42. },
  43. mainServer: {
  44. protocol: 'file://',
  45. indexPath: '/public/dist/index.html',
  46. channelSeparator: '/',
  47. }
  48. }
  49. }