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