mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
improved minifying
This commit is contained in:
parent
ba677c6e30
commit
e9a389b0a6
3 changed files with 15 additions and 29 deletions
|
@ -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")
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue