m0dch3n / vue-cli-plugin-cordova

Vue Cli 3 Cordova Plugin
MIT License
417 stars 63 forks source link

shouldn't src-cordova/node_modules be added to .gitignore ? #47

Closed vesper8 closed 5 years ago

vesper8 commented 5 years ago

That's a pretty big folder, ~18mb and almost 3000 files.. pretty big folder to be checked into a repo

And the root of src-cordova does contain a package.json

Is there a reason why this folder is not ignored, couldn't we just run yarn/npm to get those dependencies?

m0dch3n commented 5 years ago

default .gitignore from vue cli app has already

node_modules

so no need to add a second node_modules in the .gitignore...

The folder is not ignored because of package.json, package-lock.json, (these are needed for the cordova plugins), config.xml, build.json, google-services.json, GoogleService-Info.plist and other files, which you add or modifiy in cordova i.e.

vesper8 commented 5 years ago

Hrmm.. that is odd. I do have

node_modules

In my .gitignore file, but that somehow doesn't apply to the node_modules folder inside src-cordova

I have to add it explicitly like so

/src-cordova/node_modules

You're saying it works for you ?

Yea I wasn't implying the whole src-cordova file should be ignored, I understand there are required files and folders in there

m0dch3n commented 5 years ago

which operating system are you running ? are you sure you have

node_modules

and not i.e.

./node_modules
m0dch3n commented 5 years ago

and which git version

m0dch3n commented 5 years ago
A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". 

Git Documentation

So a simple

node_modules

should ignore node_modules anywhere....

m0dch3n commented 5 years ago

PS: Once you added the files to git, .gitignore is not applied to the already added files... so maybe check if you did not screw up, and take a look if

vue create testapp
cd testapp
vue add cordova
npm install

is doing the same...

vesper8 commented 5 years ago

oops.. my bad.. I've installed this plugin to two of my repos, the one who's .gitignore I checked had 'node_modules' without a leading slash. But the one who I just installed it to and was having a problem did in fact have a leading slash before node_modules

totally my fault.. sorry for the time and confusion.. thanks for the replies

m0dch3n commented 5 years ago

no problem...