m0dch3n / vue-cli-plugin-cordova

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

Add support for cordova installed as a dev dependency #87

Closed AssetKid closed 4 years ago

AssetKid commented 4 years ago

Hello,

At the moment, Cordova has to be installed globally for the generator to work

https://github.com/m0dch3n/vue-cli-plugin-cordova/blob/master/generator.js#L8-L13

It is not always possible to install packages globally due to permission restrictions. Is it possible to support Cordova installed as a dev dependencies?

Useful Links

m0dch3n commented 4 years ago

@AssetKid feel free to create PR, I'll merge it then

AssetKid commented 4 years ago

I forgot I opened this. I did attempt to make a PR but the solution was not elegant. The cwd (i.e. src-cordova) for the cordova commands and the local dependencies install location (project root) are different.

This means npx cordova commands won't work.

I did have to hard code certain paths in the project I was working on but it was not an elegant solution. I'll close this now.