mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
Compatibility for require of plugins
This commit is contained in:
@@ -59,7 +59,7 @@ var gitbook = {
|
||||
// Modules mapping for plugins
|
||||
var MODULES = {
|
||||
'gitbook': gitbook,
|
||||
'jQuery': $,
|
||||
'jquery': $,
|
||||
'lodash': _
|
||||
};
|
||||
|
||||
@@ -68,6 +68,7 @@ window.$ = $;
|
||||
window.jQuery = $;
|
||||
window.require = function(mods, fn) {
|
||||
mods = _.map(mods, function(mod) {
|
||||
mod = mod.toLowerCase();
|
||||
if (!MODULES[mod]) {
|
||||
throw new Error('GitBook module '+mod+' doesn\'t exist');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user