From d0d222dee48899e29f7d29e64d7b50434066ade8 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Fri, 8 Nov 2024 21:17:17 +0800 Subject: [PATCH] fix: cannot open vscode when use vscode-win32-x64 in Windows (#233285) When executing `npm run gulp vscode-win32-x64` on the Windows platform, the `bundle-vscode` task is triggered. However, this task does not handle the path issues well, resulting in the contents of the `bootstrap-window.js` file not being injected into `workbench.js` and `processExplorer.js`. The reason why VSCode does not encounter this issue is that the code compilation (compile-build) is performed on a Linux machine, while the Windows machine only executes the application build (vscode-win32-x64-ci will not trigger `bundle-vscode`). Signed-off-by: Kevin Cui --- build/lib/optimize.js | 2 +- build/lib/optimize.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lib/optimize.js b/build/lib/optimize.js index 478390c4228..83f34dc0745 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -71,7 +71,7 @@ function bundleESMTask(opts) { newContents = contents; } // File Content Mapper - const mapper = opts.fileContentMapper?.(path); + const mapper = opts.fileContentMapper?.(path.replace(/\\/g, '/')); if (mapper) { newContents = await mapper(newContents); } diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index 40efe87d674..8c49fa81888 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -106,7 +106,7 @@ function bundleESMTask(opts: IBundleESMTaskOpts): NodeJS.ReadWriteStream { } // File Content Mapper - const mapper = opts.fileContentMapper?.(path); + const mapper = opts.fileContentMapper?.(path.replace(/\\/g, '/')); if (mapper) { newContents = await mapper(newContents); }