From 6eb99b195ec8d8bfab38b9a650d66d17507f69d9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 17 Dec 2017 20:39:18 -0500 Subject: [PATCH] use atime.getTime() and mtime.getTime() - hopefully fixes #11 --- lib/utils/create_app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/create_app.js b/lib/utils/create_app.js index 14547af..7b6a272 100644 --- a/lib/utils/create_app.js +++ b/lib/utils/create_app.js @@ -30,7 +30,8 @@ module.exports = function create_app(src, dest, routes, options) { // need to fudge the mtime, because webpack is soft in the head const stats = fs.statSync(file); - fs.utimesSync(file, stats.atimeMs - 999999, stats.mtimeMs - 999999); + const { atime, mtime } = statSync(file); + fs.utimesSync(file, atime.getTime() - 999999, mtime.getTime() - 999999); } function create_server_routes() { @@ -46,8 +47,8 @@ module.exports = function create_app(src, dest, routes, options) { fs.writeFileSync(server_routes, `${imports}\n\n${exports}`); - const stats = fs.statSync(server_routes); - fs.utimesSync(server_routes, stats.atimeMs - 999999, stats.mtimeMs - 999999); + const { atime, mtime } = statSync(server_routes); + fs.utimesSync(server_routes, atime.getTime() - 999999, mtime.getTime() - 999999); } // TODO in dev mode, watch files