Skip to content

Instantly share code, notes, and snippets.

@tjibbevanderlaan
Last active April 20, 2017 14:54
Show Gist options
  • Save tjibbevanderlaan/d800f06e7a1c654c051667c94afb9aa4 to your computer and use it in GitHub Desktop.
Save tjibbevanderlaan/d800f06e7a1c654c051667c94afb9aa4 to your computer and use it in GitHub Desktop.
Add external module in nemo
<script id="nemoUserFunctions">
// nemo_onload is a predefined function, invoked by
// the nemo engine as soon as the topic is loaded
function nemo_onload(e) {
// RequireJS is an external module, included in the nemo
// engine, which loads all internal modules. With the following
// code, you can load your own piece of code. The module excepts
// '.js'-files, so specifying the extension name is not needed.
// Please put your own libraries in the 'userscripts'-folder!
// The NemoPackager will copy libraries only, if they are located in
// '/_web/userscripts'.
// Note: the '../../' is a small bug; requirejs searches normally in
// scripts/libs for modules
require(['../../userscripts/yourlibrary'], function(yourLibrary){
yourLibrary.doAction();
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment