Skip to content

Commit

Permalink
fix(dev-server): clear module cache on ssr reload
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Oct 1, 2020
1 parent 31e7765 commit cfd5d39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dev-server/ssr-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ async function setupHydrateApp(devServerConfig: d.DevServerConfig, serverCtx: d.
// brute force way of clearning node's module cache
// not using `delete require.cache[id]` since it'll cause memory leaks
require.cache = {};
const Module = require('module');
Module._cache[hydrateAppFilePath] = undefined;

hydrateApp = require(hydrateAppFilePath);
}
Expand Down

0 comments on commit cfd5d39

Please sign in to comment.