Skip to content

Commit 846669e

Browse files
authored
docs: add prestart hook documentation (#204)
1 parent 3910e57 commit 846669e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

config/hooks.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ You can use this hook to generate any static files or resources your app require
3232

3333
For instance, you could use this hook to generate a license file containing the license of all your dependencies.
3434

35+
### `preStart`
36+
37+
* **Arguments:**
38+
* **`config:`**[**`ResolvedForgeConfig`**](https://js.electronforge.io/interfaces/\_electron\_forge\_shared\_types.ResolvedForgeConfig.html) - Forge configuration object
39+
* **Returns: `Promise<void>`**
40+
41+
`preStart()` is invoked before Forge's **`start`** command launches the app in dev mode.
42+
43+
You can use this hook to run prepatory logic before your app launches.
44+
45+
{% code title="forge.config.js" fullWidth="false" %}
46+
```javascript
47+
module.exports = {
48+
hooks: {
49+
preStart: async (forgeConfig) => {
50+
console.log(`Starting up app on platform: ${process.platform}`);
51+
}
52+
}
53+
};
54+
```
55+
{% endcode %}
56+
3557
### `postStart`
3658

3759
* **Arguments:**

0 commit comments

Comments
 (0)