It's pretty late, but I'll just post my solution here if someone needs it.
, requireJS text! json! . String RequireJS - String, onLoad.fromText(), eval .
( db!):
define([], function(){
var db = new Database();
return {
load: function(name, req, onLoad, reqConfig){
db.get(name, function(err, scriptString){
if (err) onLoad(err);
else onLoad.fromText(scriptString);
});
}
}
});
:
require(["jquery", "db!myScript"], function($, myScript){
});
:
require() eval. , onLoad.fromText() . eval , , , String eval(). , CSP.- , . , .