Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Revert back to non-amd underscore and use require.js shim
Browse files Browse the repository at this point in the history
  • Loading branch information
chadhietala committed Jun 7, 2012
1 parent 285d36b commit 4723087
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
19 changes: 15 additions & 4 deletions index.html
Expand Up @@ -31,16 +31,27 @@ <h1>Chaplin Example Application</h1>

<script src="js/vendor/require-2.0.1.js"></script>
<script>
require.config({
requirejs.config({
baseUrl: '/js/',
paths: {
jquery: 'vendor/jquery-1.7.2',
underscore: 'vendor/underscore-1.3.3',
backbone: 'vendor/backbone-0.9.2',
handlebars: 'vendor/handlebars-1.0.0.beta.6',
text: 'vendor/require-text-1.0.8',
chaplin: 'vendor/chaplin'
chaplin: 'vendor/chaplin',
underscore: 'vendor/underscore-1.3.3',
backbone: 'vendor/backbone-0.9.2'
},
shim: {
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'underscore' :{
exports: '_'
}
},


waitSeconds: 1,
// For easier development, disable browser caching
// Of course, this should be removed in a production environment
Expand Down
19 changes: 5 additions & 14 deletions js/vendor/underscore-1.3.3.js
Expand Up @@ -48,11 +48,10 @@
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); };

// Export the Underscore object for **Node.js** and **"CommonJS"**, with
// backwards-compatibility for the old `require()` API. If we're not in
// CommonJS, add `_` to the global object via a string identifier for
// the Closure Compiler "advanced" mode. Registration as an AMD module
// via define() happens at the end of this file.
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
Expand Down Expand Up @@ -1057,12 +1056,4 @@
return this._wrapped;
};

// AMD define happens at the end for compatibility with AMD loaders
// that don't enforce next-turn semantics on modules.
if (typeof define === 'function' && define.amd) {
define('underscore', function() {
return _;
});
}

}).call(this);
}).call(this);

0 comments on commit 4723087

Please sign in to comment.