Skip to content

Commit

Permalink
GITBOOK-209: pnpm support documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored and gitbook-bot committed Feb 18, 2025
1 parent 261df86 commit c2077a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@ description: Quickly scaffold an Electron project with a full build pipeline

# Getting Started

## Overview

Electron Forge is an all-in-one tool for packaging and distributing Electron applications. It combines many single-purpose packages to create a full build pipeline that works out of the box, complete with code signing, installers, and artifact publishing. For advanced workflows, custom build logic can be added in the Forge lifecycle through its [Plugin API](config/plugins/). Custom build and storage targets can be handled by creating your own [Makers](config/makers/) and [Publishers](config/publishers/).

## Creating a new app
## Prerequisites

To get started with Electron Forge, we first need to initialize a new project with `create-electron-app`. This script is a convenient wrapper around Forge's [Init](cli.md#Init) command.
* [Node.js](https://nodejs.org/) ≥ v16.4.0
* [Git](https://git-scm.com/)
* A JavaScript package manager:
* [npm](https://www.npmjs.com/)
* [Yarn Classic](https://classic.yarnpkg.com/)
* [pnpm](https://pnpm.io/) (as of Forge v7.7.0)

{% hint style="warning" %}
Electron Forge currently only supports npm and Yarn Classic. If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
#### **Packaging requires `node_modules` to be on disk**

When packaging your Electron app, Forge crawls your project's `node_modules` folder to collect dependencies to bundle. Its module resolution algorithm is naive and doesn't take into account symlinked dependencies nor Yarn's Plug'n'Play (PnP) format.

* If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
* If you are using pnpm, please set `node-linker=hoisted` in your project's `.npmrc` configuration.
{% endhint %}

## Creating a new app

To get started with Electron Forge, we first need to initialize a new project with `create-electron-app`. This script is a convenient wrapper around Forge's [Init](cli.md#Init) command.

```bash
npx create-electron-app@latest my-app
```
Expand Down
9 changes: 9 additions & 0 deletions cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ npm run package -- --arch="ia32"
npx electron-forge package --arch="ia32"
```

{% hint style="warning" %}
#### **Packaging requires `node_modules` to be on disk**

When packaging your Electron app, Forge crawls your project's `node_modules` folder to collect dependencies to bundle. Its module resolution algorithm is naive and doesn't take into account symlinked dependencies nor Yarn's Plug'n'Play (PnP) format.

* If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
* If you are using pnpm, please set `node-linker=hoisted` in your project's `.npmrc` configuration.
{% endhint %}

### Make

This command will make distributables for your application based on your Forge config and the parameters you pass in.
Expand Down

0 comments on commit c2077a9

Please sign in to comment.