improved minifying

This commit is contained in:
Peter 'Pita' Martischka 2011-07-25 14:38:54 +01:00
parent ba677c6e30
commit e9a389b0a6
3 changed files with 15 additions and 29 deletions

View file

@ -135,7 +135,7 @@ exports.padJS = function(req, res)
var quote = item.search("_Q") != -1;
//read the included file
fs.readFile("../" + filename, "utf-8", function(err, data)
fs.readFile(filename, "utf-8", function(err, data)
{
//compress the file
if(type == "JS")

View file

@ -85,20 +85,6 @@ async.waterfall([
res.sendfile(filePath, { maxAge: exports.maxAge });
});
//if minified is disabled, we need to server the static files under /p/static too
//it looks like dynamic script loading works only for subfolders, thats the reason we're doing this
if(settings.minify == false)
{
//serve static files
app.get('/p/static/*', function(req, res)
{
res.header("Server", serverName);
var filePath = path.normalize(__dirname + "/.." + req.url.split("?")[0].replace("p/",""));
console.error(filePath);
res.sendfile(filePath, { maxAge: exports.maxAge });
});
}
//serve minified files
app.get('/minified/:id', function(req, res)
{