It seems that the function in the sample below is not exported in the same was as the string literal. I have tried in different ways to export a module with functions and namespaces, but it seems that functions generally are not exported.
Download project files: http://cl.ly/1W1a0p3y431X
My App
` ```ux
<JavaScript File="fuse-resource/fuse-resource.js" ux:Global="fuseResource" />
<JavaScript>
var resource = require('fuseResource');
debug_log('Module: '+ JSON.stringify(resource));
var demo = resource.demo;
debug_log('DEMO 1: '+ demo);
var demoFn = resource.demoFn;
debug_log('DEMO 2: '+ demoFn());
</JavaScript>
``` `
fuse-resource.js
` ```uno
module.exports = {
demo: ‘Hello Demo’,
demoFn: function() {
console.log(‘Demo’);
}
}
``` `
Output
` ```uno
LOG: Module: {“demo”:“Hello Demo”}
LOG: DEMO 1: Hello Demo
LOG: Demo
LOG: DEMO 2: undefined
``` `