vip-go-skeleton icon indicating copy to clipboard operation
vip-go-skeleton copied to clipboard

Add `node_modules` to `.gitignore`

Open chriszarate opened this issue 2 years ago • 5 comments

Node.js-driven development within WordPress plugins and themes means that developers often end up with huge node_modules folders in their projects. These are used to generate a deployment artifact and almost never need to be committed.

Accidentally committing node_modules can result in a truly epic number of tracked files and can slow down many operations, both locally and on VIP infrastructure.

chriszarate avatar Apr 04 '22 22:04 chriszarate

I am a little worried about this causing confusion for new customers, wherein they were actually relying on having node_modules committed.

WPprodigy avatar Apr 04 '22 22:04 WPprodigy

What if we add a .gitignore section in the readme to reduce the chances of unwelcome surprises.

rinatkhaziev avatar Apr 05 '22 16:04 rinatkhaziev

I like the idea of adding to the readme. My main concern here is how the issues that typically stem from this type of thing are very hidden and hard to find/debug.

I'll add though that we were able to find examples of existing codebases loading assets directly from node_modules.

WPprodigy avatar Apr 05 '22 20:04 WPprodigy

I'm removing the needs review status cause it's been alerting, but I don't think we have a good way forward w/this currently.

rinatkhaziev avatar May 19 '22 18:05 rinatkhaziev

How about adding it, but including a comment in the .gitignore file (and readme) which explains the rare circumstances under which it may need to be commented out?

Whilst it might briefly trip a new customer up in new circumstances, let's go for a sensible default for the majority of customers.

GaryJones avatar Jun 10 '22 07:06 GaryJones