fix: remove keyboardMapEntryPoints from desktop entry points and nls.messages.js generation

This commit is contained in:
Johannes
2026-02-10 17:30:14 +01:00
parent 3180e9482c
commit e562211c1f
3 changed files with 18 additions and 8 deletions

View File

@@ -135,7 +135,6 @@ function getEntryPointsForTarget(target: BuildTarget): string[] {
...desktopWorkerEntryPoints,
...desktopEntryPoints,
...codeEntryPoints,
...keyboardMapEntryPoints,
];
case 'server':
return [

View File

@@ -134,13 +134,6 @@ export async function finalizeNLS(
path.join(dir, 'nls.metadata.json'),
JSON.stringify(nlsMetadataJson, null, '\t')
),
fs.promises.writeFile(
path.join(dir, 'nls.messages.js'),
`/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(allMessages)};`
)
]));
console.log(`[nls] Extracted ${allMessages.length} messages from ${moduleToKeys.size} modules`);

View File

@@ -79,6 +79,24 @@ Two placeholders that need injection:
- Removes `webEndpointUrlTemplate` from product config (see `tweakProductForServerWeb` in old build)
- Uses `.build/extensions` for builtin extensions (not `.build/web/extensions`)
### 5. Entry Point Parity with Old Build
**Problem:** The desktop target had `keyboardMapEntryPoints` as separate esbuild entry points, producing `layout.contribution.darwin.js`, `layout.contribution.linux.js`, and `layout.contribution.win.js` as standalone files in the output.
**Root cause:** In the old build (`gulpfile.vscode.ts`), `vscodeEntryPoints` does NOT include `buildfile.keyboardMaps`. These files are only separate entry points for server-web (`gulpfile.reh.ts`) and web (`gulpfile.vscode.web.ts`). For desktop, they're imported as dependencies of `workbench.desktop.main` and get bundled into it.
**Fix:** Removed `...keyboardMapEntryPoints` from the `desktop` case in `getEntryPointsForTarget()`. Keep for `server-web` and `web`.
**Lesson:** Always verify new build entry points against the old build's per-target definitions in `buildfile.ts` and the respective gulpfiles.
### 6. NLS Output File Parity
**Problem:** `finalizeNLS()` was generating `nls.messages.js` (with `globalThis._VSCODE_NLS_MESSAGES=...`) in addition to the standard `.json` files. The old build only produces `nls.messages.json`, `nls.keys.json`, and `nls.metadata.json`.
**Fix:** Removed `nls.messages.js` generation from `finalizeNLS()` in `nls-plugin.ts`.
**Lesson:** Don't add new output file formats that create parity differences with the old build. The old build is the reference.
---
## Testing the Fix