Config file
# position
./electron/config/
# instruction
config.default.js // the default configuration file is loaded by both the development environment and the production environment
config.local.js // dev environment configuration file, append and overwrite default configuration file
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
config.developmentMode = {
default: 'vue',
mode: {
vue: {
hostname: 'localhost',
port: 8080
},
react: {
hostname: 'localhost',
port: 3000
},
html: {
hostname: 'localhost',
indexPage: 'index.html' // home
},
}
};
Developer Tools
config.openDevTools = false;
Application top menu
```
- boolean | string
- true, false, ‘dev-show’(dev show,prod hiden)
config.openAppMenu = true;
<a name="LOwWM"></a>
#### loading page (deprecated)
ee-core@1.2.6 deprecated
config.loadingPage = true;
page path
./public/html/loading.html
<a name="OGLWC"></a>
#### **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, };
<a name="g6HrW"></a>
#### **EE framework logs**
config.logger = {
appLogName: ee-${dayjs().format('YYYY-MM-DD')}.log
,
errorLogName: ee-error-${dayjs().format('YYYY-MM-DD')}.log
}
<a name="e2QIk"></a>
#### **Remote web address (optional)**
config.remoteUrl = { enable: false, url: ‘https://discuz.chat/‘ // Any web url };
<a name="YmUrb"></a>
#### **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 } };
<a name="W4GZ8"></a>
#### **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 } };
<a name="GyA8U"></a>
#### **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 };
<a name="ZOZDj"></a>
#### **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) };
<a name="csdRY"></a>
#### **Wakes up by browser (optional)**
config.awakeProtocol = { protocol: ‘ee’, // Custom protocol name (default your app name - english) args: [] };
<a name="uGE6z"></a>
#### **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