fix time code revalidate in debug mode
This commit is contained in:
parent
bbc6b83c19
commit
7b201c421d
2 changed files with 6 additions and 8 deletions
8
app.js
8
app.js
|
|
@ -597,14 +597,14 @@ function handleCode(req, res, next) {
|
|||
if (!js) {
|
||||
return http.reply404(req, res);
|
||||
}
|
||||
|
||||
if (ck) {
|
||||
let mod = lastmod(ck.path);
|
||||
let mpath = `${dir}/${ck.path}`;
|
||||
let mod = lastmod(mpath);
|
||||
if (mod > ck.mod) {
|
||||
if (debug) {
|
||||
js = code[ck.endpoint] = fs.readFileSync(ck.path);
|
||||
js = code[ck.endpoint] = fs.readFileSync(mpath);
|
||||
} else {
|
||||
js = code[ck.endpoint] = minify(ck.path);
|
||||
js = code[ck.endpoint] = minify(mpath);
|
||||
}
|
||||
ck.mod = mod;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue