* fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint line around directives issue * fix: eslint semi rule * fix: eslint newline per chain rule * fix: eslint space infix ops rule * fix: eslint space-in-parens issue * fix: eslint space before function paren issue * fix: eslint space before blocks issue * fix: eslint arrow body style issue * fix: eslint dot-location issue * fix: eslint quotes issue * fix: eslint quote props issue * fix: eslint operator assignment issue * fix: eslint new line after import issue * fix: indent issues * fix: operator assignment issue * fix: all autofixable eslint issues * fix: all react related fixable issues * fix: autofixable eslint issues * chore: remove all template literals * fix: remaining autofixable issues * chore: apply amnesty on all existing issues * fix: failing xss-lint issues * refactor: apply amnesty on remaining issues * refactor: apply amnesty on new issues * fix: remove file level suppressions * refactor: apply amnesty on new issues
52 lines
2.0 KiB
JavaScript
52 lines
2.0 KiB
JavaScript
(function(requirejs, define) {
|
|
'use strict';
|
|
|
|
// We do not wish to bundle common libraries (that may also be used by non-RequireJS code on the page
|
|
// into the optimized files. Therefore load these libraries through script tags and explicitly define them.
|
|
// Note that when the optimizer executes this code, window will not be defined.
|
|
if (window) {
|
|
var defineDependency = function(globalName, name, noShim) {
|
|
// eslint-disable-next-line no-shadow
|
|
var getGlobalValue = function(name) {
|
|
var globalNamePath = name.split('.'),
|
|
result = window,
|
|
i;
|
|
for (i = 0; i < globalNamePath.length; i++) {
|
|
result = result[globalNamePath[i]];
|
|
}
|
|
return result;
|
|
},
|
|
globalValue = getGlobalValue(globalName);
|
|
if (globalValue) {
|
|
if (noShim) {
|
|
define(name, {});
|
|
} else {
|
|
define(name, [], function() { return globalValue; });
|
|
}
|
|
} else {
|
|
console.error('Expected library to be included on page, but not found on window object: ' + name);
|
|
}
|
|
};
|
|
defineDependency('jQuery', 'jquery');
|
|
defineDependency('jQuery', 'jquery-migrate');
|
|
defineDependency('_', 'underscore');
|
|
}
|
|
requirejs.config({
|
|
baseUrl: '/base/',
|
|
paths: {
|
|
moment: 'common_static/common/js/vendor/moment-with-locales',
|
|
draggabilly: 'common_static/js/vendor/draggabilly',
|
|
'edx-ui-toolkit': 'common_static/edx-ui-toolkit',
|
|
hls: 'common_static/common/js/vendor/hls'
|
|
},
|
|
shim: {
|
|
moment: {
|
|
exports: 'moment'
|
|
},
|
|
hls: {
|
|
exports: 'Hls'
|
|
}
|
|
}
|
|
});
|
|
}).call(this, RequireJS.requirejs, RequireJS.define);
|