Massage require.js's config so that builds work

without underscore.js
This commit is contained in:
JC Brand 2017-02-02 22:38:16 +00:00
parent 63888dd454
commit da23015ced
3 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,7 @@ require.config({
"tpl": "node_modules/lodash-template-loader/loader",
"typeahead": "components/typeahead.js/index",
"lodash": "node_modules/lodash/lodash",
"underscore": "src/underscore-shim",
"utils": "src/utils",
// Converse
@ -190,6 +191,8 @@ require.config({
// for their 'jquery' dependency.
'*': {
'jquery': 'jquery-private',
},
'backbone': {
"underscore": "lodash"
},
// 'jquery-private' wants the real jQuery module
@ -222,6 +225,7 @@ require.config({
'bigint': { deps: ['crypto'] },
'strophe.ping': { deps: ['strophe'] },
'strophe.register': { deps: ['strophe'] },
'strophe.vcard': { deps: ['strophe'] }
'strophe.vcard': { deps: ['strophe'] },
'backbone': { deps: ['underscore'] }
}
});

4
src/underscore-shim.js Normal file
View File

@ -0,0 +1,4 @@
/*global define */
define('underscore', ['lodash'], function (_) {
return _;
});

View File

@ -3,6 +3,7 @@ define('jquery', [], function () { return jQuery; });
define('jquery.browser', [], function () { return jQuery; });
define('typeahead', [], function () { return jQuery; });
define('lodash', [], function () { return _; });
define('underscore', [], function () { return _; });
define('moment_with_locales', [], function () { return moment; });
define('strophe', [], function () {
return {