Skip to content

Allow customization of output targets in script/electron-builder.js#1397

Open
savetheclocktower wants to merge 1 commit intomasterfrom
allow-yarn-dist-to-pick-targets
Open

Allow customization of output targets in script/electron-builder.js#1397
savetheclocktower wants to merge 1 commit intomasterfrom
allow-yarn-dist-to-pick-targets

Conversation

@savetheclocktower
Copy link
Copy Markdown
Contributor

@savetheclocktower savetheclocktower commented Dec 31, 2025

…at least on Linux and Windows.

The documentation already thinks this is possible! (Select the “Linux” tab if you're not on Linux.) The script doesn't support this, but it ought to — especially on Linux, since building an AppImage is time-intensive. Better to change the code here than to change the docs.

We can control targets on Windows as well, so we might as well let them in on the fun and allow (e.g.) yarn dist nsis to opt into just the NSIS build and skip the portable target. (The current docs say yarn dist portable should be possible, but electron-builder calls this target zip, so I decided to keep it simple. Happy to keep it as portable if people prefer.)

If a user specifies targets that don't match their current platform, they will be ignored. Default behavior has not changed; if no applicable targets are provided, then the whole list of them should be generated.

Feel free to test this for your specific platform; I did sanity checking on Linux, but I didn't try to run each individual option in isolation.

@ottok
Copy link
Copy Markdown

ottok commented Jan 4, 2026

Would you like to include a unpacked 'dir' target too like I did in 7c5eee3 ?

@savetheclocktower
Copy link
Copy Markdown
Contributor Author

I'll consider it!

@DeeDeeG
Copy link
Copy Markdown
Member

DeeDeeG commented Mar 13, 2026

Might be natively supported by electron-builder, just with different invocation (flags) than our docs had thought?

[ . . . snipped . . . ]

Building:
  --mac, -m, -o, --macos   Build for macOS, accepts target list (see
                           https://www.electron.build/mac)               [array]
  --linux, -l              Build for Linux, accepts target list (see
                           https://www.electron.build/linux)             [array]
  --win, -w, --windows     Build for Windows, accepts target list (see
                           https://www.electron.build/win)               [array]
  --x64                    Build for x64                               [boolean]
  --ia32                   Build for ia32                              [boolean]
  --armv7l                 Build for armv7l                            [boolean]
  --arm64                  Build for arm64                             [boolean]
  --universal              Build for universal (mac only)              [boolean]
  --dir                    Build unpacked dir. Useful to test.         [boolean]
  
  [ . . . snipped . . . ]

From: https://www.electron.build/cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants