description |
---|
How to write custom templates for Electron Forge. |
Templates in Electron Forge implement the ForgeTemplate
interface, namely:
requiredForgeVersion
(required) - the semantic version range of Electron Forge versions that this template supports. For example,^6.0.0-beta.1
dependencies
(optional) - a list of package identifiers that you pass to a package manager (which may include a version range) to add to thedependencies
field inpackage.json
. For example,jquery
orjquery@^3.0.0
devDependencies
(optional) - a list of package identifiers that you pass to a package manager (which may include a version range) to add to thedevDependencies
field inpackage.json
. For example,eslint
oreslint@^7.0.0
initializeTemplate
(optional) - anasync
function that allows the template to perform custom actions, for example copying files from atmpl
folder into the new app. The exact function signature is defined in the shared types package.
To use the custom template, run the init command and point the template at the file that contains the ForgeTemplate
implementation.