Writing Templates
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.1dependencies(optional) - a list of package identifiers that you pass to a package manager (which may include a version range) to add to thedependenciesfield inpackage.json. For example,jqueryorjquery@^3.0.0devDependencies(optional) - a list of package identifiers that you pass to a package manager (which may include a version range) to add to thedevDependenciesfield inpackage.json. For example,eslintoreslint@^7.0.0initializeTemplate(optional) - anasyncfunction that allows the template to perform custom actions, for example copying files from atmplfolder 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.
Last updated
Was this helpful?