If you look at the source for jQuery.keyboard, it uses the UMD template twice in the code:
Once in https://github.com/Mottie/Keyboard/blob/master/js/jquery.keyboard.js#L31 and once https://github.com/Mottie/Keyboard/blob/master/js/jquery. keyboard.js # L2165 .
SystemJS detects the file as AMD, but it identifies itself twice, not once.
Basically, this is not a valid AMD module, so you should tell SystemJS to treat it as global.
This can be done by overriding:
jspm install github:mottie/keyboard -o "{format: 'global'}"
Even then, the above requires that jQuery is already loaded. To do this, we can add a jQuery pad to provide dependency.
The standard jQuery override plugin with padding is as follows:
override.json
{ "main": "js/jquery.keyboard.js", "shim": { "js/jquery.keyboard": { "deps": ["jquery"] } }, "dependencies": { "jquery": "*" } }
We can install this with:
jspm install github:mottie/keyboard -o override.json
Post your redefinition in the jspm registry if that works, and then other users will also be able to take advantage.
guybedford
source share