Skip to content

Commit 3aa4ae4

Browse files
committed
Clarify why we need node_modules.asar
1 parent 121a520 commit 3aa4ae4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ci/build/npm-postinstall.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ vscode_yarn() {
4242
cd lib/vscode
4343
yarn --production --frozen-lockfile
4444

45-
# VS Code needs a node_modules.asar but that's just a duplicate of stuff we
46-
# already have in node_modules.
45+
# This is a copy of symlink_asar in ../lib.sh. Look there for details.
4746
if [ ! -e node_modules.asar ]; then
4847
if [ "${WINDIR-}" ]; then
49-
# mklink takes the link name first.
5048
mklink /J node_modules.asar node_modules
5149
else
52-
# ln takes the link name second.
5350
ln -s node_modules node_modules.asar
5451
fi
5552
fi

ci/lib.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ export OS
9595
# Defaults to release
9696
RELEASE_PATH="${RELEASE_PATH-release}"
9797

98-
# Symlink node_modules.asar to node_modules. VS Code needs a node_modules.asar
99-
# but that's just a duplicate of stuff we already have in node_modules.
98+
# VS Code bundles some modules into an asar which is an archive format that
99+
# works like tar. It then seems to get unpacked into node_modules.asar.
100+
#
101+
# I don't know why they do this but all the dependencies they bundle already
102+
# exist in node_modules so just symlink it. We have to do this since not only VS
103+
# Code itself but also extensions will look specifically in this directory for
104+
# files (like the ripgrep binary or the oniguruma wasm).
100105
symlink_asar() {
101106
if [ ! -e node_modules.asar ]; then
102107
if [ "${WINDIR-}" ]; then

0 commit comments

Comments
 (0)