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

Commit

Permalink
use atime.getTime() and mtime.getTime() - hopefully fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 18, 2017
1 parent 442ce36 commit 6eb99b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/utils/create_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit 6eb99b1

Please sign in to comment.