mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
support HMR
This commit is contained in:
@@ -25,7 +25,7 @@ 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(main_built);
|
||||
fs.utimesSync(main_built, stats.atimeMs - 9999, stats.mtimeMs - 9999);
|
||||
fs.utimesSync(main_built, stats.atimeMs - 999999, stats.mtimeMs - 999999);
|
||||
}
|
||||
|
||||
function create_server_routes() {
|
||||
@@ -42,7 +42,7 @@ 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 - 9999, stats.mtimeMs - 9999);
|
||||
fs.utimesSync(server_routes, stats.atimeMs - 999999, stats.mtimeMs - 999999);
|
||||
}
|
||||
|
||||
// TODO in dev mode, watch files
|
||||
|
||||
Reference in New Issue
Block a user