Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 6eb99b1

Browse files
committed
use atime.getTime() and mtime.getTime() - hopefully fixes #11
1 parent 442ce36 commit 6eb99b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/utils/create_app.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = function create_app(src, dest, routes, options) {
3030

3131
// need to fudge the mtime, because webpack is soft in the head
3232
const stats = fs.statSync(file);
33-
fs.utimesSync(file, stats.atimeMs - 999999, stats.mtimeMs - 999999);
33+
const { atime, mtime } = statSync(file);
34+
fs.utimesSync(file, atime.getTime() - 999999, mtime.getTime() - 999999);
3435
}
3536

3637
function create_server_routes() {
@@ -46,8 +47,8 @@ module.exports = function create_app(src, dest, routes, options) {
4647

4748
fs.writeFileSync(server_routes, `${imports}\n\n${exports}`);
4849

49-
const stats = fs.statSync(server_routes);
50-
fs.utimesSync(server_routes, stats.atimeMs - 999999, stats.mtimeMs - 999999);
50+
const { atime, mtime } = statSync(server_routes);
51+
fs.utimesSync(server_routes, atime.getTime() - 999999, mtime.getTime() - 999999);
5152
}
5253

5354
// TODO in dev mode, watch files

0 commit comments

Comments
 (0)