File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import path from 'node:path';
5
5
import { promisify } from 'node:util' ;
6
6
7
7
import express , { static as expressStatic } from 'express' ;
8
- import { Configuration , webpack } from 'webpack' ;
8
+ import { Compiler , Configuration , webpack } from 'webpack' ;
9
9
10
10
import { createFsFromVolume , Volume } from './volume' ;
11
11
@@ -15,6 +15,8 @@ export interface CompilerFileSystems {
15
15
intermediateFileSystem ?: Volume ;
16
16
}
17
17
18
+ type IntermediateFileSystem = Compiler [ 'intermediateFileSystem' ] ;
19
+
18
20
export async function compile (
19
21
input : Volume ,
20
22
config : Configuration ,
@@ -25,8 +27,8 @@ export async function compile(
25
27
26
28
compiler . inputFileSystem = createFsFromVolume ( input ) ;
27
29
compiler . outputFileSystem = createFsFromVolume ( output ) ;
28
- compiler . intermediateFileSystem =
29
- intermediateFileSystem ?? ( compiler . outputFileSystem as Volume ) ;
30
+ compiler . intermediateFileSystem = ( intermediateFileSystem ??
31
+ compiler . outputFileSystem ) as IntermediateFileSystem ;
30
32
31
33
const stats = await promisify ( compiler . run . bind ( compiler ) ) ( ) ;
32
34
await promisify ( compiler . close . bind ( compiler ) ) ( ) ;
Original file line number Diff line number Diff line change 1
- export { createFsFromVolume } from 'memfs' ;
2
- export { Volume } from 'memfs/lib/volume' ;
1
+ import { createFsFromVolume as memfsCreateFsFromVolume } from 'memfs' ;
2
+ import { Volume } from 'memfs/lib/volume' ;
3
+ import { InputFileSystem , OutputFileSystem } from 'webpack' ;
4
+
5
+ export const createFsFromVolume = memfsCreateFsFromVolume as unknown as (
6
+ ...args : Parameters < typeof memfsCreateFsFromVolume >
7
+ ) => Volume & InputFileSystem & OutputFileSystem ;
8
+
9
+ export { Volume } ;
You can’t perform that action at this time.
0 commit comments