moodle/lib/requirejs/moodle-config.js
Damyon Wiese 7b18365be7 MDL-60458 javascript: MathJax Workaround
Mathjax currently has a bug in an upstream library that is incorrectly
loading 'process' because it things it's running under Node.js.

We don't load modules by shortname - so it should be fine to map process to
something else.

Because of the syntax they used we need to map it to something that is already loaded
and evaluates to null (Their code will then assume the module could not be loaded and continue).

We have a handy module that is guaranteed to be loaded first and evaluates to null -> core/first.

We should remove this workaround when MathJax releases a fixed version on their CDN and update the docs.
2017-10-25 12:30:21 +08:00

28 lines
929 B
JavaScript

var require = {
baseUrl : '[BASEURL]',
// We only support AMD modules with an explicit define() statement.
enforceDefine: true,
skipDataMain: true,
waitSeconds : 0,
paths: {
jquery: '[JSURL]lib/jquery/jquery-3.2.1.min[JSEXT]',
jqueryui: '[JSURL]lib/jquery/ui-1.12.1/jquery-ui.min[JSEXT]',
jqueryprivate: '[JSURL]lib/requirejs/jquery-private[JSEXT]'
},
// Custom jquery config map.
map: {
// '*' means all modules will get 'jqueryprivate'
// for their 'jquery' dependency.
'*': { jquery: 'jqueryprivate' },
// Stub module for 'process'. This is a workaround for a bug in MathJax (see MDL-60458).
'*': { process: 'core/first' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
jqueryprivate: { jquery: 'jquery' }
}
};