Please note that underscore.js is not registered as an AMD module (although it was executed for a short time in earlier versions), therefore it cannot be used in the require () call without any configuration using "shim:" here So:
require.config({ paths: { jquery: 'lib/jquery.min', underscore: 'lib/underscore-min' } shim: { "underscore": { exports: "_" } } });
See the docs at: http://requirejs.org/docs/api.html#config-shim
Before shim: was added to require.js, you could do something similar with the use.js plugin (if you need to use an older version of require.js).
At the time of writing the current version of require.js is 2.1.8.
Alternatively, you can use lodash.js as a replacement for underscore.js - it registers as an AMD module, so you can use it without additional configuration: http://lodash.com/
source share