Necesito moduleA y moduleB para tener un contexto diferente. moduleA y moduleB son bibliotecas javascript existentes que solicitan un módulo de 'contexto'.
¿Es posible cuando requerimos que el módulo A o el módulo B pasen en una versión diferente del contexto u otra forma de diferenciar
// EXISTING libraries, can not alter: // moduleA uses 'context' define(["context"], function (context) {}); // moduleB also uses 'context' define(["context"], function (context) {}); // MY code: // ❌. Can define a 'global' context here, but it will be the same for both. define("context", () => {}); // ✅ Possible to let moduleA require a different context then module B ?? // On requiring module A, or a different way requirejs(["moduleA"],()=>{ // console.log('run when moduleA and thus context are loaded }); requirejs(["moduleB"],()=>{ // console.log('run when moduleB and thus context are loaded });