dev/+js: speed up nvm init
This commit is contained in:
parent
e3dcd040d6
commit
77302fd4c5
|
@ -1,4 +1,13 @@
|
||||||
path=(./node_modules/.bin $path)
|
|
||||||
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[[ -s "$NVM_DIR/nvm.sh" ]] && . "$NVM_DIR/nvm.sh"
|
|
||||||
|
# [[ -s "$NVM_DIR/nvm.sh" ]] && . "$NVM_DIR/nvm.sh"
|
||||||
|
|
||||||
|
# Sourcing nvm.sh adds a noticable slow-down on startup, so we scan for
|
||||||
|
# the current version's path ourselves.
|
||||||
|
# NOTE This assumes you use the `node` nvm alias, e.g. `nvm install node`
|
||||||
|
npmpaths=( $HOME/.nvm/versions/node/*/bin(On) )
|
||||||
|
path=("${npmpaths[1]}" $path)
|
||||||
|
|
||||||
|
# Local binaries take priority
|
||||||
|
path=(./node_modules/.bin $path)
|
||||||
|
|
Loading…
Reference in a new issue