electron / electron/forge

Optional dependencies excluded with plugin-vite

Open
#3,599 1 comment 4 reactions 0 assignees View on GitHub
bug package plugin/vite
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 17m
Merged PRs (30d)
32

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

7.4.0

### Electron version

29.2.0

### Operating system

macOS 14.5

### Last known working Electron Forge version

_No response_

### Expected behavior

When building an app with optional dependencies and the Vite plugin, optional dependencies are included in the build output.

### Actual behavior

Optional dependencies are excluded from the output.

### Steps to reproduce

Build a project using https://github.com/lovell/sharp, which has optional dependencies. They will not be in the packaged node_modules, and so their native binaries can not be copied.

### Additional information

Adding them as dependencies is a poor solution, since they are platform-specific.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.