From: Dan Allen Date: Wed, 11 Nov 2020 21:59:23 +0000 (-0700) Subject: fix reducer that computes mtime for bundled file X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c18b14c3298ed738ec28c9449ab9231adb5b89d6;p=eg-antora.git fix reducer that computes mtime for bundled file --- diff --git a/gulp.d/tasks/build.js b/gulp.d/tasks/build.js index 7a5e929..f9e46ee 100644 --- a/gulp.d/tasks/build.js +++ b/gulp.d/tasks/build.js @@ -76,7 +76,7 @@ module.exports = (src, dest, preview) => () => { }) .bundle((bundleError, bundleBuffer) => Promise.all(mtimePromises).then((mtimes) => { - const newestMtime = mtimes.reduce((max, curr) => (!max || curr > max ? curr : max)) + const newestMtime = mtimes.reduce((max, curr) => (curr > max ? curr : max), file.stat.mtime) if (newestMtime > file.stat.mtime) file.stat.mtimeMs = +(file.stat.mtime = newestMtime) if (bundleBuffer !== undefined) file.contents = bundleBuffer file.path = file.path.slice(0, file.path.length - 10) + '.js'