Electron Forge
  • Getting Started
  • Importing an Existing Project
  • CLI
  • Core Concepts
    • Why Electron Forge?
    • Build Lifecycle
  • Configuration
    • Configuration Overview
    • TypeScript Setup
    • Plugins
      • Webpack Plugin
      • Vite Plugin
      • Electronegativity Plugin
      • Auto Unpack Native Modules Plugin
      • Local Electron Plugin
      • Fuses Plugin
    • Makers
      • AppX
      • deb
      • DMG
      • Flatpak
      • pkg
      • RPM
      • Snapcraft
      • Squirrel.Windows
      • WiX MSI
      • ZIP
    • Publishers
      • Bitbucket
      • Electron Release Server
      • GitHub
      • Google Cloud Storage
      • Nucleus
      • S3
      • Snapcraft
    • Hooks
  • Built-in Templates
    • Webpack
    • Webpack + Typescript
    • Vite
    • Vite + TypeScript
  • Guides
    • Code Signing
      • Signing a Windows app
      • Signing a macOS app
    • Custom App Icons
    • Framework Integration
      • React
      • React with TypeScript
      • Vue 3
    • Developing with WSL
  • Advanced
    • Auto Update
    • Debugging
    • Extending Electron Forge
      • Writing Plugins
      • Writing Templates
      • Writing Makers
      • Writing Publishers
    • API Docs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Advanced
  2. Extending Electron Forge

Writing Templates

How to write custom templates for Electron Forge.

PreviousWriting PluginsNextWriting Makers

Last updated 3 years ago

Was this helpful?

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 the dependencies field in package.json. For example, jquery or jquery@^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 the devDependencies field in package.json. For example, eslint or eslint@^7.0.0

  • initializeTemplate (optional) - an async function that allows the template to perform custom actions, for example copying files from a tmpl folder into the new app. The exact function signature is defined in the shared types package.

To use the custom template, run the command and point the template at the file that contains the ForgeTemplate implementation.

init