Config file

  1. # position
  2. ./electron/config/
  3. # instruction
  4. config.default.js // the default configuration file is loaded by both the development environment and the production environment
  5. config.local.js // dev environment configuration file, append and overwrite default configuration file
  6. config.prod.js // pro environment configuration file, append and overwrite default configuration file

Parameter:appInfo object

  • name application Name
  • baseDir the path of the electron directory in the framework. If encryption is used, the packaged path is./public/electron.
  • env environment variables, local-local, prod-production environment
  • home APP root directory path
  • root the data directory of the APP in the operating system varies according to environment variables.
  • appUserDataDir the data directory of the APP in the operating system, independent of environment variables.
  • userHome the home directory of the operating system user.
  • appVersion APP version
  • isPackaged APP has it been packed
  • execDir After the APP is installed, the root directory of the executable program (EXE, DMG, DEP)

    Description

    dev mode configuration

    1. config.developmentMode = {
    2. default: 'vue',
    3. mode: {
    4. vue: {
    5. hostname: 'localhost',
    6. port: 8080
    7. },
    8. react: {
    9. hostname: 'localhost',
    10. port: 3000
    11. },
    12. html: {
    13. hostname: 'localhost',
    14. indexPage: 'index.html' // home
    15. },
    16. }
    17. };

    Developer Tools

    1. config.openDevTools = false;

    Application top menu

    ```
  • boolean | string
  • true, false, ‘dev-show’(dev show,prod hiden) config.openAppMenu = true;
    1. <a name="LOwWM"></a>
    2. #### loading page (deprecated)

    ee-core@1.2.6 deprecated

config.loadingPage = true;

page path

./public/html/loading.html

  1. <a name="OGLWC"></a>
  2. #### **Main window**

// more:https://www.electronjs.org/zh/docs/latest/api/browser-window#new-browserwindowoptions config.windowsOption = { width: 980, // width height: 650, // height minWidth: 800, // minimum width minHeight: 650, // minimum height webPreferences: { //webSecurity: false, // If you need to cross domain, please open contextIsolation: false, // isolate nodeIntegration: true, // node }, frame: true, show: true, };

  1. <a name="g6HrW"></a>
  2. #### **EE framework logs**

config.logger = { appLogName: ee-${dayjs().format('YYYY-MM-DD')}.log, errorLogName: ee-error-${dayjs().format('YYYY-MM-DD')}.log }

  1. <a name="e2QIk"></a>
  2. #### **Remote web address (optional)**

config.remoteUrl = { enable: false, url: ‘https://discuz.chat/‘ // Any web url };

  1. <a name="YmUrb"></a>
  2. #### **Built-in socket service**

The third-party software can communicate with the EE framework through the socket client listening port

config.socketServer = { enable: false, port: 7070, // default port isDynamic: false, // If the value is false,The framework uses the port by default (if the default port is used, a random one will be obtained);If it is true, the default port is invalid, and the framework generates it randomly path: “/socket.io/“, // Default path name connectTimeout: 45000, // Client connection timeout pingTimeout: 30000, // Heartbeat detection timeout pingInterval: 25000, // Heartbeat detection interval maxHttpBufferSize: 1e8, // Maximum data per message 1M transports: [“polling”, “websocket”], // http polling and websocket cors: { origin: true, // http, allow cross domain } };

  1. <a name="W4GZ8"></a>
  2. #### **Built-in http service**

EE program can be accessed in front end, browser and terminal command

config.httpServer = { enable: false, port: 7071, // Default port (if the port is used, one will be obtained at random) cors: { origin: “*” // cross domain } };

  1. <a name="GyA8U"></a>
  2. #### **Main process **

config.mainServer = { host: ‘127.0.0.1’, port: 7072, // Default port (if the port is used, one will be obtained at random) options: {} // https://www.electronjs.org/zh/docs/latest/api/browser-window#winloadurlurl-options };

  1. <a name="ZOZDj"></a>
  2. #### **Automatic application upgrade (optional)**

config.autoUpdate = { windows: false, // windows macOS: false, // macOs Signature verification required linux: false, // linux options: { provider: ‘generic’, // or github, s3, bintray url: ‘http://kodo.qiniu.com/‘ // resource dir, end with ‘/‘ }, force: false, // Forced update (when running the software, check the new version and download and install it in the background) };

  1. <a name="csdRY"></a>
  2. #### **Wakes up by browser (optional)**

config.awakeProtocol = { protocol: ‘ee’, // Custom protocol name (default your app name - english) args: [] };

  1. <a name="uGE6z"></a>
  2. #### **Tray (optional)**

config.tray = { title: ‘EE APP’, // Tray display title icon: ‘/public/images/tray_logo.png’ // tray logo } ```

Encrypt config

./config/encrypt.js
see:Code encryption