Archived
1
0

Rebuild all node_modules on npm install

Stuff like ripgrep needs to be refetched so we cannot bundle
node_modules at all.
This commit is contained in:
Anmol Sethi
2020-05-18 21:30:24 -04:00
parent 5f94d5a687
commit 6f1309795e
5 changed files with 22 additions and 40 deletions

View File

@ -24,24 +24,18 @@ main() {
;;
esac
cd lib/vscode
# We have to rename node_modules.bundled to node_modules.
# The bundled modules were renamed originally to avoid being ignored by yarn.
node_modules="$(find . -depth -name "node_modules.bundled")"
for nm in $node_modules; do
rm -Rf "${nm%.bundled}"
mv "$nm" "${nm%.bundled}"
done
# $npm_config_global makes npm rebuild return without rebuilding.
unset npm_config_global
# Rebuilds native modules.
if ! npm rebuild; then
if ! vscode_yarn; then
echo "You may not have the required dependencies to build the native modules."
echo "Please see https://github.com/cdr/code-server/blob/master/doc/npm.md"
exit 1
fi
}
vscode_yarn() {
cd lib/vscode
yarn --production --frozen-lockfile
cd extensions
yarn --production --frozen-lockfile
}
main "$@"