Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

desktop-external-packages.ts

25 lines845 Bytes

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 "@trycua/cua-driver",
10 "@ubjs/",
11 // Playwright reads its runtime bundle/driver from disk; inlining cannot replace those files.
12 "playwright-core",
13] as const;
14​
15export function isDesktopRuntimeExternalDependency(id: string): boolean {
16 return DESKTOP_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => id.startsWith(prefix));
18​
19export function selectDesktopRuntimeExternalDependencies(
20 dependencies: Readonly<Record<string, string>>,
21): Record<string, string> {
22 return Object.fromEntries(
23 Object.entries(dependencies).filter(([name]) => isDesktopRuntimeExternalDependency(name)),
24 );