Skip to content

Commit 63a1cea

Browse files
committed
Merge remote-tracking branch 'magento-l3/ACP2E-2045' into SEP292023_PR_pradeep
2 parents 2b3ad2e + bbd94e2 commit 63a1cea

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/web/mage/requirejs/mixins.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ define('mixins', [
66
'module'
77
], function (module) {
88
'use strict';
9-
109
var contexts = require.s.contexts,
1110
defContextName = '_',
1211
defContext = contexts[defContextName],
13-
unbundledContext = require.s.newContext('$'),
12+
unbundledContextName = '$',
13+
unbundledContext = contexts[unbundledContextName] = require.s.newContext(unbundledContextName),
1414
defaultConfig = defContext.config,
1515
unbundledConfig = {
1616
baseUrl: defaultConfig.baseUrl,
@@ -205,7 +205,10 @@ require([
205205
var contexts = require.s.contexts,
206206
defContextName = '_',
207207
defContext = contexts[defContextName],
208+
unbundledContextName = '$',
209+
unbundledContext = contexts[unbundledContextName],
208210
originalContextRequire = defContext.require,
211+
originalContextConfigure = defContext.configure,
209212
processNames = mixins.processNames;
210213

211214
/**
@@ -219,6 +222,15 @@ require([
219222
return originalContextRequire(deps, callback, errback);
220223
};
221224

225+
/**
226+
* Wrap original context configuration to update unbundled context,
227+
* that way it is able to respect any changes done after mixins module has initialized.
228+
*/
229+
defContext.configure = function (cfg) {
230+
originalContextConfigure(cfg);
231+
unbundledContext.configure(cfg);
232+
};
233+
222234
/**
223235
* Copy properties of original 'require' method.
224236
*/

0 commit comments

Comments
 (0)