Skip to content

Commit

Permalink
Remove extraneous require cache set
Browse files Browse the repository at this point in the history
  • Loading branch information
airhorns committed Oct 9, 2024
1 parent 34a8ca9 commit 1b17ec5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/child-process-cjs-hook.cts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ if (!workerData || !(workerData as SyncWorkerData).isWDSSyncWorker) {
for (const extension of process.env["WDS_EXTENSIONS"]!.split(",")) {
require.extensions[extension] = (module: any, filename: string) => {
const compiledFilename = compileOffThread(filename);
if (typeof compiledFilename === "string") {
if (typeof compiledFilename === "string" || !compiledFilename.ignored) {
const content = fs.readFileSync(compiledFilename, "utf8");
notifyParentProcessOfRequire(filename);
module._compile(content, filename);
}
};
}

require.cache ??= {};

// monitor the parent process' health, if it dies, kill ourselves so we don't end up a zombie
const monitor = setInterval(() => {
try {
Expand Down

0 comments on commit 1b17ec5

Please sign in to comment.