fix reducer that computes mtime for combined CSS file
authorDan Allen <dan@opendevise.com>
Sun, 29 Nov 2020 00:37:35 +0000 (17:37 -0700)
committerDan Allen <dan@opendevise.com>
Sun, 29 Nov 2020 00:37:35 +0000 (17:37 -0700)
gulp.d/tasks/build.js

index f9e46ee..4640a5e 100644 (file)
@@ -31,7 +31,7 @@ module.exports = (src, dest, preview) => () => {
           .reduce((accum, { file: depPath, type }) => (type === 'dependency' ? accum.concat(depPath) : accum), [])
           .map((importedPath) => fs.stat(importedPath).then(({ mtime }) => mtime))
       ).then((mtimes) => {
-        const newestMtime = mtimes.reduce((max, curr) => (!max || curr > max ? curr : max))
+        const newestMtime = mtimes.reduce((max, curr) => (!max || curr > max ? curr : max), file.stat.mtime)
         if (newestMtime > file.stat.mtime) file.stat.mtimeMs = +(file.stat.mtime = newestMtime)
       }),
     postcssUrl([