fix: stack size exceed error on purging module cache
This commit is contained in:
parent
7404c9aacf
commit
3c1024a071
4 changed files with 75 additions and 26 deletions
|
|
@ -8,7 +8,7 @@ import * as path from "path";
|
|||
|
||||
import { Config, ConfigPaths } from "./config";
|
||||
import { renderPage } from "./render";
|
||||
import { purgeModuleAndDepsFromCache, walkDir } from "./utils";
|
||||
import { decacheModule, walkDir } from "./utils";
|
||||
|
||||
const renderPagesToHtml = async ({
|
||||
pagesDir,
|
||||
|
|
@ -22,7 +22,7 @@ const renderPagesToHtml = async ({
|
|||
}
|
||||
|
||||
// Ensure that we don't cache page modules when running in dev server.
|
||||
purgeModuleAndDepsFromCache(srcPath);
|
||||
decacheModule(srcPath);
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pageSrc = require(srcPath);
|
||||
if (!("page" in pageSrc)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue