How to add external javascript file dependency for javascript plugin for Cordoba?

I am going to create a Cordova plugin for javascript that will use some external javascript dependencies. As I understand it, all external js files should be packed in a www folder like this

<asset src="lib/restful.js" target="www/lib/restful.js" />

but what should I do next? How to register it as modules in order to make it accessible from the Javascript code of the Cordova plugin like this?

var restful = require('restful');

What are the best practices for using external javascript libraries from javascript plugin code in Cordova?

+4
source share

Source: https://habr.com/ru/post/1675250/


All Articles