node.js - Adding node_modules to repo makes ZSH slow -


i added node_modules directory version control per this answer's advice.

(by way, i'm not of opinion adding node_modules version control practice, i'm trying deployment working , don't have else try right now.)

my problem every command run followed five-second pause before command prompt back. assume because have ~700mb node_modules directory.

is there way speed zsh or have live slowness if decide check in node_modules?

your question not clear infer happening is:

  • you have zsh and/or zsh plugins configured include aspects of git repo status in prompt
  • thus each time zsh goes render prompt, has run 1 or more git commands
  • because repository large, these commands tend slow

if indeed case, first thing should alter zsh configuration keep these details out of prompt. can done temporarily while working on particular project. might alleviate biggest pain point without cost/effort.

secondly, try make node_modules small possible npm dedupe. eliminate dev dependencies npm prune --production dev deps local files deps necessary prod in git. might require clever/verbose configuration in .gitignore may workable.

but deps-in-git path failure reasons this. source code management source code.