mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Simplify AMD loader config options.
Former-commit-id: 69a89fe05e45f508fefe445f147da5aa4da8fc7b
This commit is contained in:
@@ -102,44 +102,49 @@
|
||||
if (window.curl) {
|
||||
var require = curl;
|
||||
}
|
||||
if (!window.require) {
|
||||
init(_);
|
||||
} else {
|
||||
(function() {
|
||||
if (!window.require) {
|
||||
init(_);
|
||||
return;
|
||||
}
|
||||
var modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
reBasename = /[\w.-]+$/;
|
||||
|
||||
var locationPath = /modularize/.test(ui.urlParams.build)
|
||||
? '../modularize'
|
||||
: modulePath.replace(reBasename, '');
|
||||
|
||||
var pluginPath = window.curl
|
||||
? ui.loaderPath.replace(reBasename, 'curl/plugin/js!')
|
||||
: '';
|
||||
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
// load Lo-Dash as a module
|
||||
require((function() {
|
||||
var reModularize = /modularize/;
|
||||
|
||||
var baseUrl = reModularize.test(ui.urlParams.build)
|
||||
? '../modularize/'
|
||||
: '';
|
||||
|
||||
var modulePath = reModularize.test(ui.urlParams.build)
|
||||
? 'lodash'
|
||||
: ui.buildPath.replace(/\.js$/, '');
|
||||
|
||||
return {
|
||||
'baseUrl': baseUrl,
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'paths': {
|
||||
'lodash': modulePath
|
||||
require({
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'packages': [
|
||||
{
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': 'lodash'
|
||||
}
|
||||
};
|
||||
}()),
|
||||
]
|
||||
},
|
||||
['lodash'], function(lodash) {
|
||||
init(lodash);
|
||||
require([
|
||||
'../vendor/underscore/test/collections.js',
|
||||
'../vendor/underscore/test/arrays.js',
|
||||
'../vendor/underscore/test/functions.js',
|
||||
'../vendor/underscore/test/objects.js',
|
||||
'../vendor/underscore/test/utility.js'
|
||||
pluginPath + '../vendor/underscore/test/collections.js',
|
||||
pluginPath + '../vendor/underscore/test/arrays.js',
|
||||
pluginPath + '../vendor/underscore/test/functions.js',
|
||||
pluginPath + '../vendor/underscore/test/objects.js',
|
||||
pluginPath + '../vendor/underscore/test/utility.js'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
<script type="text/html" id="template">
|
||||
<%
|
||||
|
||||
Reference in New Issue
Block a user