-
Notifications
You must be signed in to change notification settings - Fork 24.4k
[5.0] Add "node_modules" to .gitignore #3240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Seems sensible if Laravel's going to push Elixir. A person unfamiliar with the node ecosystem should be able to use Elixir with ease, however I don't feel they should necessarily know up-front that they should add node_modules to their global .gitignore file.
I'm aware this issue has appeared a few times and it's be declined, however I really feel this is just one less hurdle to using Elixir & everything Node. |
Please add |
Nope, L5 contains a |
Still, node_modules belongs in your global gitignore. It's not specific to Laravel. |
Stuff like .gitignore is for project specific files. |
Laravel 5 use NodeJS (https://github.com/laravel/laravel/blob/develop/package.json) so |
Yes, it should be in your global They'd follow the docs, Then imagine they share their project with someone else on their team. Now everyone else has to learn this best-practice from Node's eco-system. I'm all for encouraging a best-practice, but I think it's just common sense to make this a default. (Yes, Homestead may come with this built-in, but not everyone will use it). |
Can't see why /node_modules shouldn't be in gitignore, when /vendor is? I think it makes sense, and it would definitely help many more people than it would hurt :) |
I also think |
The problem with adding node_modules here is encouraging bad practices, what about adding Adding node_modules will open the door to cater for all these files when it shouldn't because they have nothing to do with this project, they should be added in a global ignore file. There's no need to make the .gitignore file unnecessary long. The vendor folder is added because composer is a hard dependency, Laravel needs this to work so it's considered part of the project, whereas gulp is optional. I think it'd be better to add a reference to this in the documentation to encourage people to set up a global ignore file instead. |
Imho node_modules is different the IDE/OS specific files. It's a file that's always generated when using npm install with the default package.json file. Also, I'm not sure if the node _modules folder even belongs in a global gitignore. It might for php development but when you're creating node apps you might want to include the dependencies.. |
@jahvi I agree with you about IDE/OS files. But Laravel 5 use NodeJS so it's a project specific folder. With your reflexion we can also pull out |
@RomainLanz Yes but L5 doesn't rely on NodeJS, you can take it out and it'll still work however if you take the vendor folder out it won't work. I agree with @barryvdh in a way though, it could be added just because elixir comes by default to avoid confusion. I think global ignore is just for OS/Editor specific files, I may have added it because I never work on Node apps. |
Yes, Laravel 5 doesn't rely on NodeJS but the default installation has Elixir that rely on NodeJS. When you do a fresh install of Laravel 5 and want to commit on your repository the |
I agree that at this point with the addition of elixir that node_modules should be ignored by git. Node offers a shrink wrap similar to composer.lock to lock files so that's no longer an issue as before. Node modules aren't the same as ide or is folders/files at all. Instead it is much more comparable to the vendor dir that composer creates. In the past I was on the fence as this would possibly open the floodgates for people to ask for other dep folders from other dev tools, however the blessing of elixir and a package.json file in L5 lock me into saying that node modules should be included. The same argument could not be made for other folders for other package managers (ie bower) |
Also with older versions of npm not supporting shrinkwrap, there are legacy projects that unfortunately do need committed node_modules directories. |
I agree with @barryvdh - I was under the impression that your global ignore file is for things specific to you (i.e. folders created by your IDE or OS), whereas the local/version-controlled ignore file should include things specific to the project. |
Actually, with Elixir becoming a default part of Laravel I do agree that it should be in the .gitignore file. Still, if you use node on more than on project (also goes for composer), adding it globally is a good idea. I think for those just getting started with Laravel adding it to the local .gitignore would be a welcome change. |
[5.0] Add "node_modules" to .gitignore
This should be in global .gitignore |
Seems sensible if Laravel's going to push Elixir.
A person unfamiliar with the node ecosystem should be able to use Elixir with ease, however I don't feel they should necessarily know up-front that they should add node_modules to their global
.gitignore
file.