외부 requireJS 응용 프로그램에서 togetherJS (https://togetherjs.com/docs/contributing.html) 모듈에 액세스하려고합니다. 불가능 해 보입니다.요구 사항이 다른 컨텍스트의 액세스 모듈
TogetherJSConfig_noAutoStart = true;
var CJS = CJS || {};
CJS.require = require.config({
paths: {
togetherjs: 'https://togetherjs.com/togetherjs-min',
cjs: 'scripts/c'
}
});
CJS.require(['togetherjs'], function() {
// not working
peers = require({context: "togetherjs"})("peers");
// not working
// Module name "peers" has not been loaded yet for context: togetherjs. Use require([])
TogetherJS.require = require.config(TogetherJS.requireConfig);
TogetherJS.require("peers");
});
내 응용 프로그램에서 requireJS를 사용하지 않는 경우, 내가 원하는 모듈에 액세스 할 수 있습니다
// works if I do not use requireJS in my app.
var peers = TogetherJS.require('peers').getAllPeers();
이 가능하고, 만약 그렇다면, 어떻게? 아무 데서도 정보를 찾을 수 없었습니다.
감사합니다.