The build process is founded upon rollup bundler which compiles and brings every piece together. There are three entry files for your code:
src/main.ts, the script running at the main Electron process, orchestrating the whole application;
src/rootWindow.ts, the script that renders the UI of the root window, the app's main window;
and src/preload.ts, which runs in a privileged mode to connect the app and the webviews rendering Rocket.Chat's web client.
Adding Node.js Modules
To extend the app's functionalities with modules, always remember to differentiate between modules needed as dependencies and devDependencies in package.json. Like any other package depending project, only modules listed in dependencies will be included in the distributable final app.
Using a servers.json file will help define what servers the client will connect to. When specified, it will automatically populate the server list in the sidebar.
This file contains a list of default servers that will be added the first time the user runs the app and also when all servers are removed from the list. The file syntax is as follows:
You can bundle a servers.json with the install package, the file should be located in the root of the project application (same level as the package.json).
If the file is found, the initial "Connect to server" screen will be skipped and it will attempt to connect to the first server defined in the array. When that is done, it will take the user straight to the login screen.
Note that the servers.json will only be checked if no other servers have already been added, even if you uninstall the app without removing older preferences, it will not be triggered again.
If you cannot (or don't want to) bundle the file inside the app, you can create a servers.json in the user preferences folder which will overwrite the packaged one. The file should be located in any of the directories listed below.