Open History to see the last commit
1/** Keep bundler externals aligned with the staged production dependency list. */
2const DESKTOP_RUNTIME_EXTERNAL_PREFIXES = [
3 "@napi-rs/keyring",
4 "@crowecawcaw/xa11y",
5 "@clerk/electron-passkeys",
6 "electron-webauthn",
7 "ffi-rs",
8 "@yuuang/",
9 // Playwright reads its runtime bundle/driver from disk; inlining cannot replace those files.
10 "playwright-core",
11] as const;
12
13export function isDesktopRuntimeExternalDependency(id: string): boolean {
14 return DESKTOP_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => id.startsWith(prefix));
15}
16
17export function selectDesktopRuntimeExternalDependencies(
18 dependencies: Readonly<Record<string, string>>,
19): Record<string, string> {
20 return Object.fromEntries(
21 Object.entries(dependencies).filter(([name]) => isDesktopRuntimeExternalDependency(name)),
22 );
23}