javascript - How to load all dependency of urijs by rquirejs config? -


i want include library use https://github.com/medialize/uri.js/tree/master

i have added bower.json

{   "name": "my-project",   "version": "1.0.0",   "dependencies": {        "urijs": "~1.16.1"  }  ... } 

when load project in browser, got these error:

enter image description here

these scripts part of urijs project. can find them here: https://github.com/medialize/uri.js/tree/master/src

i able resolve requirejs configuration alone minimal change (i.e. not need specify each dependent script indiviudally). easiest way define dependency?

is possible? if so, how?

at end can resolve creating final artefact , hosted outcome in forked project. hoping more elegant and/or simpler solution.

looks uri.js sets universal module loader should work requirejs. doesn't have reference every script in config. make requirejs config file readme.md:

require.config({   paths: {     urijs: 'where-you-put-uri.js/src'   } });  require(['urijs/uri'], function(uri) {   console.log("uri.js , dependencies: ", uri("//amazon.co.uk").is('sld') ? 'loaded' : 'failed'); }); require(['urijs/uritemplate'], function(uritemplate) {   console.log("uritemplate.js , dependencies: ", uritemplate._cache ? 'loaded' : 'failed'); }); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -