Skip to content

Commit

Permalink
Fix load order of xhr
Browse files Browse the repository at this point in the history
  • Loading branch information
humphd committed Apr 4, 2014
1 parent 5c13b22 commit 4d72468
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requirejs.config({
}
});

requirejs(['filer', 'webserver', 'xhr'], function(Filer, WebServer) {
requirejs(['filer', 'webserver'], function(Filer, WebServer) {
var Path = Filer.Path;

function install(file) {
Expand Down Expand Up @@ -89,7 +89,11 @@ requirejs(['filer', 'webserver', 'xhr'], function(Filer, WebServer) {
// Case 3: a path was given into the web root, try to serve it.
// Strip any server added trailing slash (unless we have '/').
var url = option === '/' ? option : option.replace(/\/$/, '');
WebServer.serve(url);

// We need to swap out the XHR implementation when loading from the filesystem
require(['xhr'], function() {
WebServer.serve(url);
});
}

boot();
Expand Down

0 comments on commit 4d72468

Please sign in to comment.