From 3f4f2c8b2333faf7cebea0c21e7e7002f4e16891 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 30 Jun 2026 12:18:23 +0900 Subject: [PATCH] Revert "fix: store node_modules at top level inside asar archive" This reverts commit 4747aa5e375cc1fe49b8eb510dd1acec1fd6a581. --- build/lib/asar.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build/lib/asar.ts b/build/lib/asar.ts index 68288c1940ae..873b3f946fd9 100644 --- a/build/lib/asar.ts +++ b/build/lib/asar.ts @@ -109,15 +109,11 @@ export function createAsar(folderPath: string, unpackGlobs: string[], skipGlobs: })); } const shouldUnpack = shouldUnpackFile(file); - // Strip the `node_modules/` prefix so that modules live at the top level - // of the archive (`node_modules.asar/`), matching both the - // `node_modules.asar.unpacked/` layout and how the archive is - // referenced at runtime. This keeps a single, consistent top-level layout. - const relative = path.relative(folderPath, file.path); - insertFile(relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack); + insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack); if (shouldUnpack) { // The file goes outside of xx.asar, in a folder xx.asar.unpacked + const relative = path.relative(folderPath, file.path); this.queue(new VinylFile({ base: '.', path: path.join(destFilename + '.unpacked', relative),