Skip to content

Commit

Permalink
Docs: add electron to bundlers section
Browse files Browse the repository at this point in the history
If you're using asar, you'll also need to configure asarUnpack.
  • Loading branch information
lovell committed Jan 3, 2024
1 parent 0499f59 commit 8cd8326
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/install.md
Expand Up @@ -231,6 +231,21 @@ custom:
- npm install --os=linux --cpu=x64 sharp
```

### electron

Ensure sharp is unpacked from the ASAR archive file using the
[asarUnpack](https://www.electron.build/configuration/configuration.html)
option.

```json
{
"build": {
"asar": true,
"asarUnpack": ["**/node_modules/sharp/**/*"]

This comment has been minimized.

Copy link
@nosferatu500

nosferatu500 Jan 4, 2024

In my case it's throwing runtime error until I add additional line to asarUnpack: "**/node_modules/@img/**/*"

so, in my case it's looks like:

"asarUnpack": ["**/node_modules/sharp/**/*", "**/node_modules/@img/**/*"]

This comment has been minimized.

Copy link
@lovell

lovell Jan 4, 2024

Author Owner

Thank you, I suspected this would be the case for some Electron tooling (but e.g. it looks like Forge might do this automagically?), so I've updated via commit 4aacee8 as it's always good to make these things explicit.

}
}
```

## TypeScript

TypeScript definitions are published as part of
Expand Down

0 comments on commit 8cd8326

Please sign in to comment.