Skip to content

Commit

Permalink
fix: missing type for compiler.inputFileSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 16, 2024
1 parent 018d4ac commit 7bc724c
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 26 deletions.
10 changes: 7 additions & 3 deletions packages/rspack-test-tools/src/processor/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ export class StatsProcessor<
? instance.compilers
: [instance];
for (const compiler of compilers) {
if (!compiler.inputFileSystem) {
continue;
}
const ifs = compiler.inputFileSystem;
compiler.inputFileSystem = Object.create(ifs);
compiler.inputFileSystem.readFile = (...args: any[]) => {
const inputFileSystem = Object.create(ifs);
compiler.inputFileSystem = inputFileSystem;
inputFileSystem.readFile = (...args: any[]) => {
const callback = args.pop();
ifs.readFile.apply(
ifs,
Expand All @@ -60,7 +64,7 @@ export class StatsProcessor<
return callback(null, result);
callback(null, escapeEOL(result.toString("utf-8")));
}
])
]) as Parameters<typeof ifs.readFile>
);
};

Expand Down
Loading

0 comments on commit 7bc724c

Please sign in to comment.