Don’t index node_modules by Spotlight
It’s pretty key to turn off Spotlight for developer directories with tons of files. There’s just no reason you’ll use the Mac find to look for node_modules
.
These two aliases should be useful to clean stop MacOS from indexing your node_modules
folder.
alias fix-spotlight="find . -path '*node_modules/*' -prune -o -type d -name 'node_modules' -exec touch '{}/.metadata_never_index' \;"
alias fix-spotlight-globally="find ~ -type d -path './.*' -prune -o -path './Pictures*' -prune -o -path './Library*' -prune -o -path '*node_modules/*' -prune -o -type d -name 'node_modules' -exec touch '{}/.metadata_never_index' \; -print"
Backup Drives
Another tip is to place any external backup drives to your Spotlight hidden folder:
Related to: