Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
do not try to include views/tests from minified bundle (bug 990319)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Apr 1, 2014
1 parent 3d32cb5 commit 14b9fab
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions hearth/media/js/routes.js
Expand Up @@ -28,13 +28,25 @@ var routes = [

{'pattern': '^/collection/([^/<>"\']+)/?$', 'view_name': 'collection'},

{'pattern': '^/tests$', 'view_name': 'tests'},
{'pattern': '^/debug$', 'view_name': 'debug'},
{'pattern': '^/debug/features$', 'view_name': 'debug_features'},
{'pattern': '^/credits$', 'view_name': 'credits'}
];

dependencies = routes.map(function(i) {return 'views/' + i.view_name;});
// Only `require.js` has `window.require.defined`, so we can use this to
// sniff for whether we're using the minified bundle or not. (In production
// we use commonplace's `amd.js`.)
if (window.require.hasOwnProperty('defined')) {
// The minified JS bundle doesn't need some dev-specific JS views.
// Those go here.
routes = routes.concat([
{'pattern': '^/tests$', 'view_name': 'tests'}
]);
}

dependencies = routes.map(function(i) {
return 'views/' + i.view_name;
});
/* /dtrace */
window.routes = routes;

Expand Down

0 comments on commit 14b9fab

Please sign in to comment.