mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
0b63d0f25b
commit
67f0ffb4da
2 changed files with 21 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"cache" : {"allowed" : true},
|
||||
"cache" : {"allowed" : false},
|
||||
"minification" : {
|
||||
"js" : true,
|
||||
"js" : false,
|
||||
"css" : true,
|
||||
"html" : true,
|
||||
"img" : true
|
||||
|
|
|
|||
26
server.js
26
server.js
|
|
@ -389,14 +389,26 @@ CloudServer._controller=function(pReq, pRes)
|
|||
* and minimizing setted then minimize it
|
||||
*/
|
||||
else if(lName.indexOf('min') < 0 &&
|
||||
CloudFunc.checkExtension(lName, ['js','css','html']) &&
|
||||
CloudServer.Minify)
|
||||
CloudServer.Minify.optimize(lName, {
|
||||
cache: true,
|
||||
callback: function(pFileData){
|
||||
lReadFileFunc_f(undefined, pFileData, false);
|
||||
}
|
||||
});
|
||||
|
||||
var lMin_o = CloudServer.Config.minification;
|
||||
var isAllowd_b = false;
|
||||
if(CloudFunc.checkExtension(lName, 'js') && lMin_o.js)
|
||||
isAllowd_b = true;
|
||||
|
||||
else if(CloudFunc.checkExtension(lName, 'css') && lMin_o.css)
|
||||
isAllowd_b = true;
|
||||
|
||||
else if(CloudFunc.checkExtension(lName, 'html') && lMin_o.html)
|
||||
isAllowd_b = true;
|
||||
|
||||
if(isAllowd_b)
|
||||
CloudServer.Minify.optimize(lName, {
|
||||
cache: true,
|
||||
callback: function(pFileData){
|
||||
lReadFileFunc_f(undefined, pFileData, false);
|
||||
}
|
||||
});
|
||||
|
||||
else Fs.readFile(lName, lReadFileFunc_f);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue