kopia lustrzana https://github.com/c9/core
change updateRequireConfig in language.js to work with mini_require
rodzic
131091a73f
commit
da2f81a890
|
@ -588,13 +588,8 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRequireConfig(modulePath, worker) {
|
function updateRequireConfig(modulePath, worker) {
|
||||||
var path = window.requirejs.toUrl(modulePath, "", true);
|
var config = window.requirejs.getConfig();
|
||||||
var url = require.toUrl(path);
|
worker.call("updateRequireConfig", [config]);
|
||||||
if (/^\w+:/.test(url)) {
|
|
||||||
var paths = {};
|
|
||||||
paths[path] = url;
|
|
||||||
worker.call("initBaseUrls", [paths]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.on("load", function() {
|
plugin.on("load", function() {
|
||||||
|
|
|
@ -53,6 +53,10 @@ window.initSender = function initSender() {
|
||||||
var main = window.main = null;
|
var main = window.main = null;
|
||||||
var sender = window.sender = null;
|
var sender = window.sender = null;
|
||||||
|
|
||||||
|
window.updateRequireConfig = function(config) {
|
||||||
|
window.require.config(config);
|
||||||
|
};
|
||||||
|
|
||||||
window.onmessage = function(e) {
|
window.onmessage = function(e) {
|
||||||
var msg = e.data;
|
var msg = e.data;
|
||||||
if (msg.event && sender) {
|
if (msg.event && sender) {
|
||||||
|
|
Ładowanie…
Reference in New Issue