@@ -38,28 +38,14 @@ These are available as additional dependencies in the Visual Studio Installer.
3838</TabItem >
3939</Tabs >
4040
41- :::tip Nx commands are preferred.
42-
43- We now recommend using Nx commands for building projects. For desktop:
44-
45- ``` bash
46- # Build and serve (including the native module)
47- npx nx serve desktop
48- ```
49-
50- For complete Nx documentation and all available commands, see
51- [ Using Nx to Build Projects] ( https://github.com/bitwarden/clients/blob/main/docs/using-nx-to-build-projects.md ) .
52- :::
53-
5441## Build native module
5542
5643The desktop application relies on a native module written in rust, which needs to be compiled
57- separately. This is baked in to the build process for ` npm run electron ` , but you can also compile
58- it manually . See [ Desktop Native] ( ./desktop-native/index.mdx ) for more information.
44+ separately. This is baked in to ` npx nx serve desktop ` , but you can also compile it manually with
45+ Nx . See [ Desktop Native] ( ./desktop-native/index.mdx ) for more information.
5946
6047``` bash
61- cd apps/desktop/desktop_native/napi
62- npm run build
48+ npx nx build-native desktop
6349```
6450
6551** Note** : This module needs to be re-built if the native code has changed.
@@ -94,13 +80,28 @@ npm run build -- --target x86_64-unknown-linux-musl # Replace with relevant targ
9480
9581## Build instructions
9682
97- Build and run:
83+ We recommend using Nx commands to build the desktop application. Run the following from the
84+ repository root to build and serve (this also compiles the native module):
85+
86+ ``` bash
87+ npx nx serve desktop
88+ ```
89+
90+ For complete Nx documentation and all available commands, see
91+ [ Using Nx to Build Projects] ( https://github.com/bitwarden/clients/blob/main/docs/using-nx-to-build-projects.md ) .
92+
93+ ## Manual build commands
94+
95+ Before the migration to Nx, the desktop application was built and run directly with npm scripts.
96+ These commands are still available but are no longer the recommended approach.
9897
9998``` bash
10099cd apps/desktop
101100npm run electron
102101```
103102
103+ This script also compiles the native module before launching Electron.
104+
104105## Debugging
105106
106107See [ Debugging with VS Code] ( ../debugging.mdx#desktop ) for how to attach the VS Code debugger to the
0 commit comments