Skip to content

Commit

Permalink
add prestart hook docs
Browse files Browse the repository at this point in the history
  • Loading branch information
georgexu99 committed Nov 12, 2024
1 parent 3910e57 commit 5f44f11
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions config/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>`**

`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:**
Expand Down

0 comments on commit 5f44f11

Please sign in to comment.