replace .nocache with .cachever

This commit is contained in:
Stewart Allen 2020-11-17 15:49:41 -05:00
commit bf42d4cf30

8
app.js
View file

@ -185,8 +185,8 @@ function initModule(mod, file, dir) {
} else { } else {
script[code].splice(0, 0, path); script[code].splice(0, 0, path);
} }
if (opt.nocache) { if (opt.cachever) {
nocache[path] = true; cachever[path] = opt.cachever;
} }
}, },
path: { path: {
@ -364,7 +364,7 @@ const script = {
}; };
// prevent caching of specified modules // prevent caching of specified modules
const nocache = {}; const cachever = {};
const db = { const db = {
// -------- // --------
@ -677,7 +677,7 @@ function concatCode(array) {
if (debug) { if (debug) {
const code = [ '(function() { let load = [ ' ]; const code = [ '(function() { let load = [ ' ];
direct.forEach(file => { direct.forEach(file => {
const vers = nocache[file] ? Date.now() : version; const vers = cachever[file] || version;
code.push(`"/${file.replace(/\\/g,'/')}?${vers}",`); code.push(`"/${file.replace(/\\/g,'/')}?${vers}",`);
}); });
code.push([ code.push([