Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 16, 2024
1 parent 7bc724c commit daff3ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/rspack/src/node/NodeEnvironmentPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
type LoggerConsole,
createConsoleLogger
} from "../logging/createConsoleLogger";
import type { InputFileSystem } from "../util/fs";
import NodeWatchFileSystem from "./NodeWatchFileSystem";
import nodeConsole from "./nodeConsole";

Expand Down Expand Up @@ -45,15 +46,18 @@ export default class NodeEnvironmentPlugin {
}) as LoggerConsole)
});

const inputFileSystem = new CachedInputFileSystem(fs, 60000);
const inputFileSystem: InputFileSystem = new CachedInputFileSystem(
fs,
60000
);
compiler.inputFileSystem = inputFileSystem;
compiler.outputFileSystem = fs;
compiler.intermediateFileSystem = fs;
compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem);
compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => {
if (compiler.inputFileSystem === inputFileSystem) {
compiler.fsStartTime = Date.now();
inputFileSystem?.purge();
inputFileSystem?.purge?.();
}
});
}
Expand Down

0 comments on commit daff3ac

Please sign in to comment.