This plugin can be used on: .js files and even on .coffee, .ts and .jsx files after using the right plugin.
Options :
- name : the name of the module to be published
- wrap : either the code must be wrapped or not in a function(){}
, default false
The code passed to the plugin should be a function that returns the object literal:
function () {
function foo(){...}
function foofoo(){...}
return {foo:foo, foofoo:foofoo}
}
but if wrap:true
is passed then it is expectd to be just the content of the function:
function foo(){...}
function foofoo(){...}
return {foo:foo, foofoo:foofoo}
Sample usage:
malta app/source/mod.js public -plugins=malta-umd[name:\"myMod\"]
or in the .json file :
"app/source/mod.js" : "public -plugins=malta-umd[name:\"myMod\"]"
or in a script :
var Malta = ;Maltastart {var s = this;consoleconsole;'plugin' in o && console;console;};