change updateRequireConfig in language.js to work with mini_require

This commit is contained in:
nightwing 2018-03-21 12:43:46 +04:00
parent 131091a73f
commit da2f81a890
2 changed files with 6 additions and 7 deletions

View File

@ -588,13 +588,8 @@ define(function(require, exports, module) {
}
function updateRequireConfig(modulePath, worker) {
var path = window.requirejs.toUrl(modulePath, "", true);
var url = require.toUrl(path);
if (/^\w+:/.test(url)) {
var paths = {};
paths[path] = url;
worker.call("initBaseUrls", [paths]);
}
var config = window.requirejs.getConfig();
worker.call("updateRequireConfig", [config]);
}
plugin.on("load", function() {

View File

@ -53,6 +53,10 @@ window.initSender = function initSender() {
var main = window.main = null;
var sender = window.sender = null;
window.updateRequireConfig = function(config) {
window.require.config(config);
};
window.onmessage = function(e) {
var msg = e.data;
if (msg.event && sender) {