Skip to content

Commit

Permalink
fix(makers): config can also be a function
Browse files Browse the repository at this point in the history
Co-authored-by: Erick Zhao <[email protected]>
  • Loading branch information
instilled and erickzhao authored Jul 4, 2024
1 parent 0e4854a commit 0e45038
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions config/makers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ Makers are Electron Forge's way of taking your packaged application and making p
Each maker has to be configured in the `makers` section of your forge configuration with which platforms to run for and the maker specific config. E.g.

{% tabs %}
{% tab title="forge.config.js" %}
```javascript
module.exports = {
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'linux'],
config: {
// the config can be an object
}
},
{
name: '@electron-forge/maker-dmg',
config: (arch) => ({
// it can also be a function taking the currently built arch
// as a parameter and returning a config object, e.g.
})
}
]
};
```
{% endtab %}
{% tab title="package.json" %}
```jsonc
// If your config is only in package.json:
Expand All @@ -32,24 +54,6 @@ Each maker has to be configured in the `makers` section of your forge configurat
}
```
{% endtab %}

{% tab title="forge.config.js" %}
```javascript
// If you have set config.forge to a JavaScript file path in package.json:
// Only showing the relevant configuration for brevity
module.exports = {
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'linux'],
config: {
// Config here
}
}
]
};
```
{% endtab %}
{% endtabs %}

Please note that all makers have logical defaults for the `platforms` value so you normally don't need to specify that property.
Expand Down

0 comments on commit 0e45038

Please sign in to comment.