Revert "fix: store node_modules at top level inside asar archive"

This reverts commit 4747aa5e375cc1fe49b8eb510dd1acec1fd6a581.
This commit is contained in:
deepak1556 committed 2026-07-07 13:24:41 +09:00
1 parent 1258cfad1e
commit 3f4f2c8b23
1 file changed
+2 -6
+2 -6
View File
@@ -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/<module>`), matching both the
// `node_modules.asar.unpacked/<module>` 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),