UPDATE: js file must have extension .xsjslib (from Thomas Jung)
Use external libraries in XS Engine
Should look like this:
/////////////////////////////////////////////
STRUCTURE:
-Content
--MyPackage
---MyApp.xsjs
---MyLib.xsjslib
//////////////////////////////////////////////
MyApp.xsjs code:
$.import("MyPackage","MyLib");
var x = $.MyPackage.MyLib.MyObject.MyFunction("my test string");
$.response.setBody(x);
///////////////////////////////////////////////
MyLib.xsjslib code:
var MyObject:{
MyFunction: function (myString) {
return = "You passed in the string: " + myString;
}
};