perf(electron): speed up Windows packaging with ASAR (#1190)

* perf(electron): package Windows app with ASAR

* fix(electron): use portable ASAR unpack glob

* fix(electron): unpack native modules from ASAR
This commit is contained in:
Tommaso Casaburi
2026-08-01 12:50:23 +02:00
committed by GitHub
parent f2f6c0ecb7
commit a67c66de0d
7 changed files with 93 additions and 26 deletions
+13 -4
View File
@@ -11,10 +11,12 @@ const config = {
appBundleId: '5chan.desktop',
icon: './public/icon', // electron-forge adds the correct extension per platform
// NOTE: asar is disabled because of a bug where electron-packager silently fails
// during asar creation with 5chan's large node_modules. The app works fine without it.
// TODO: investigate and fix the asar creation issue
asar: false,
// Keep Squirrel from processing the deeply nested dependency tree as loose files.
// Kubo and native modules still need real filesystem paths at runtime.
asar: {
// Use forward slashes so minimatch also recognizes the glob on Windows.
unpackDir: 'bin/**/*',
},
// Exclude unnecessary files from the package
ignore: [
@@ -81,6 +83,13 @@ const config = {
},
},
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
makers: [
// macOS
{