Prevent iCloud from Syncing /node_modules/ Folder »
Update: This was too hard to maintain, and things “got weird” sometimes. I’ve moved to Dropbox instead, very happy.
I have my localhost server on iCloud. Cloud syncing, in my opinion, is the most reliable way to ensure what you’re working on is backedup to the second.
However, 18,000+ file folders like
/node_modules/ is just ridiculous to have syncing. I have nothing to prove this, but I’m certain having one or more folders like this would at some point negatively effect syncing and/or indexing.
So, as far as I’ve found the best way to prevent folders like
/node_modules/ from syncing is appending
.nosync to the end, then symbolically linking to.
This gives you a nice little “Ineligible” tag on your huge folder, and your symbolic link sits there.
To setup, in your project folder, just run
mv node_modules node_modules.nosync
ln -s node_modules.nosync/ node_modules