Install node dependencies for Cordova plugin

后端 未结 1 1449
Happy的楠姐
Happy的楠姐 2021-01-11 16:18

I\'m writing a Cordova plugin, it has a node dependency for one of the hook scripts. Ideally when my plugin is installed:

$ cordova plugin add my-cordova-plu         


        
相关标签:
1条回答
  • 2021-01-11 16:47

    I you're looking for to add npm modules to your Cordova project, you don't need a plugin, juste use a simple hook triggered before_prepare.

    This hook will run all the npm install you need for each cordova prepare (also for cordova run, cordova compile, etc..).

    You don't have to make a JS file for a hook, a linux shell script is enough (although it is less portable). I prefer to use juste .sh file when my only need is to do "npm install" or stuff like that.

    0 讨论(0)
提交回复
热议问题