From c18b14c3298ed738ec28c9449ab9231adb5b89d6 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 11 Nov 2020 14:59:23 -0700 Subject: [PATCH] fix reducer that computes mtime for bundled file --- gulp.d/tasks/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- 2.11.0