Better manifest patch for assets url

This commit is contained in:
Ghislain Loaec 2015-08-05 00:30:56 +02:00
parent 40b421fed1
commit 78419aa45b
1 changed files with 6 additions and 2 deletions

View File

@ -209,14 +209,18 @@ var app = {
var rootPath = fileSystem.root.toURL();
// Patch path to local in manifest response
var manifestResponse = response.replace(/assets\//g, rootPath+'assets/');
var manifestResponse = response.replace(/(['"\(])\/?(assets\/^['"\)]*)(['"\)])/g, function(match, q1, path, q2){
return q1+rootPath+match+q2;
});
// Callback
cb(manifestResponse);
});
} else {
var manifestResponse = response.replace(/assets\//g, DEBUG_WWW_URL+'assets/');
var manifestResponse = response.replace(/(['"\(])\/?(assets\/^['"\)]*)(['"\)])/g, function(match, q1, path, q2){
return q1+rootPath+match+q2;
});
cb(manifestResponse);
}
},