Skip to content

Commit 7fe63cb

Browse files
author
Keen Yee Liau
committed
build: use NPM to install node_modules
`semver` is a prod dependency of `vscode-languageclient`. In the old build pipeline, `vscode-languageclient` is declared in `client/package.json`. When yarn installs dependencies in the `client` directory, it will put `semver` next to `vscode-languageclient` in `client/node_modules`. In the new build pipeline, `vscode-languageclient` is declared in root `package.json`. When yarn installs dependencies in the root directory, it chooses not to hoist `semver`, instead puts it in a nested node_modules under `node_modules/vscode-languageclient/node_modules`. There is a bug in vsce that causes it to ignore nested `node_modules`, resulting in a `vsix` build that is broken. The issue is trackeed [here](microsoft/vscode-vsce#432), but it does not look like a fix will come any time soon. For now we should install our dependencies using NPM.
1 parent 2b9ef98 commit 7fe63cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rm -rf **/*.tsbuildinfo
1313
yarn run compile
1414

1515
# Copy files to package root
16-
cp package.json yarn.lock angular.png CHANGELOG.md README.md dist/npm
16+
cp package.json angular.png CHANGELOG.md README.md dist/npm
1717
# Copy files to server directory
1818
cp server/package.json server/README.md dist/npm/server
1919
# Build and copy files to syntaxes directory
@@ -23,9 +23,11 @@ mkdir dist/npm/syntaxes
2323
cp syntaxes/!(tsconfig).json dist/npm/syntaxes
2424

2525
pushd dist/npm
26-
yarn install --production --ignore-scripts
26+
# TODO(kyliau): vsce does not bundle nested node_modules due to bug
27+
# https://github.com/microsoft/vscode-vsce/issues/432 so install using NPM for now.
28+
npm install --production --ignore-scripts
2729

2830
sed -i -e 's#./dist/client/extension#./index#' package.json
29-
../../node_modules/.bin/vsce package --yarn --out ngls.vsix
31+
../../node_modules/.bin/vsce package
3032

3133
popd

0 commit comments

Comments
 (0)