config.js 994 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. const path = require('path');
  3. const dayjs = require('dayjs');
  4. exports.get = function () {
  5. const _config = {
  6. log: {
  7. file: {
  8. fileName: path.join(__dirname, '../logs/electron-' + dayjs().format('YYYY-MM-DD') + '.log'),
  9. level: 'silly', // error, warn, info, verbose, debug, silly
  10. format: '[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] {text}',
  11. maxSize: '1048576' // 1048576 (1mb) by default.
  12. }
  13. },
  14. windowsOption: {
  15. width: 800,
  16. height: 600,
  17. minWidth: 800,
  18. minHeight: 600,
  19. webPreferences: {
  20. //webSecurity: false,
  21. nodeIntegration: true,
  22. preload: path.join(__dirname, 'preload.js')
  23. },
  24. //frame: false,
  25. //titleBarStyle: 'hidden'
  26. },
  27. egg: {
  28. title: 'electron-egg',
  29. env: 'prod',
  30. port: 7068,
  31. hostname: '0.0.0.0',
  32. workers: 1
  33. }
  34. }
  35. return _config;
  36. };
  37. exports.setup = function () {
  38. return true;
  39. };
  40. exports = module.exports;