Skip to content

Commit 2172c2e

Browse files
committed
Merge pull request #456 from purusho/master
[RFC] Fix require
2 parents a450430 + 70c80ba commit 2172c2e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

shared/app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ var Backbone = require('backbone'),
77
Fetcher = require('./fetcher'),
88
ModelUtils = require('./modelUtils'),
99
isServer = (typeof window === 'undefined'),
10-
defaultRouterModule = 'app/router';
10+
ClientRouter;
1111

1212
if (!isServer) {
13+
ClientRouter = require('app/router');
1314
Backbone.$ = window.$ || require('jquery');
1415
}
1516

@@ -73,7 +74,9 @@ module.exports = Backbone.Model.extend({
7374
* Initialize the `ClientRouter` on the client-side.
7475
*/
7576
if (!isServer) {
76-
var ClientRouter = this.options.ClientRouter || require(defaultRouterModule);
77+
if (this.options.ClientRouter) {
78+
ClientRouter = this.options.ClientRouter;
79+
}
7780

7881
new ClientRouter({
7982
app: this,

0 commit comments

Comments
 (0)