# perf\(desktop\): ship Windows server tree as a server.asar sidecar · stienswout/t3code

[View on GitCafe](https://git.cafe/stienswout/t3code/commit/1e2eba366edcf2a126ac1ed38915e084dd87b222)

Repository: [stienswout/t3code](https://git.cafe/stienswout/t3code)

Visibility: public

Requested revision: 1e2eba366edcf2a126ac1ed38915e084dd87b222

Requested commit: 1e2eba366edcf2a126ac1ed38915e084dd87b222

Commit: 1e2eba366edcf2a126ac1ed38915e084dd87b222

Tree: 7893a850c5ecdd573ba63cef49a980231ae6cb15

Author: Wout Stiens

Committer: Wout Stiens

## Message

```
perf(desktop): ship Windows server tree as a server.asar sidecar

Windows was the only platform whose installer unpacked the entire server
node_modules tree (thousands of loose files) next to app.asar, purely so a
future WSL backend could read it — dominating NSIS install and update time
for every user while the WSL backend is off by default.

Package the server bundle + a hoisted, win32+linux production dependency
tree into resources/server.asar instead (native binaries in the
server.asar.unpacked sibling). The Windows primary runs the server from
inside the archive via the asar-aware ELECTRON_RUN_AS_NODE runtime — the
same mechanism macOS/Linux already use for app.asar — and enabling the WSL
backend extracts the sidecar once into a version-keyed directory under the
desktop state dir (DesktopWslServerTree), swept and re-extracted on app
updates. Extraction failures surface through the existing WSL preflight
retry/reason channel.

app.asar now carries only the desktop main-process dependencies on Windows;
macOS and Linux packaging is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

```

## Parents

- [78f462c4e18c8ea5e5037dc916389a3b72246025](https://git.cafe/stienswout/t3code/commit/78f462c4e18c8ea5e5037dc916389a3b72246025?format=markdown)

[Source at this commit](https://git.cafe/stienswout/t3code/tree/1e2eba366edcf2a126ac1ed38915e084dd87b222?format=markdown)
