From 846669e0171d6dfa104e4e8577e162275ce8d1fc Mon Sep 17 00:00:00 2001 From: George Xu <33054982+georgexu99@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:12:55 -0800 Subject: [PATCH] docs: add prestart hook documentation (#204) --- config/hooks.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/config/hooks.md b/config/hooks.md index e8ddf0f..09411de 100644 --- a/config/hooks.md +++ b/config/hooks.md @@ -32,6 +32,28 @@ You can use this hook to generate any static files or resources your app require For instance, you could use this hook to generate a license file containing the license of all your dependencies. +### `preStart` + +* **Arguments:** + * **`config:`**[**`ResolvedForgeConfig`**](https://js.electronforge.io/interfaces/\_electron\_forge\_shared\_types.ResolvedForgeConfig.html) - Forge configuration object +* **Returns: `Promise`** + +`preStart()` is invoked before Forge's **`start`** command launches the app in dev mode. + +You can use this hook to run prepatory logic before your app launches. + +{% code title="forge.config.js" fullWidth="false" %} +```javascript +module.exports = { + hooks: { + preStart: async (forgeConfig) => { + console.log(`Starting up app on platform: ${process.platform}`); + } + } +}; +``` +{% endcode %} + ### `postStart` * **Arguments:**