1818import webpack from 'webpack' ;
1919// @ts -ignore
2020import virtualModulesPlugin from 'webpack-virtual-modules' ;
21- import { createFsFromVolume , Volume } from 'memfs' ;
21+ import { createFsFromVolume , IFs , Volume } from 'memfs' ;
2222import path from 'path' ;
2323import { projectRoot } from '../util' ;
2424
@@ -35,7 +35,7 @@ export async function bundleWithWebpack(
3535 const entryFileName = '/virtual_path_to_in_memory_file/index.js' ;
3636 const outputFileName = 'o.js' ;
3737
38- const resolveConfig : webpack . Resolve = {
38+ const resolveConfig : webpack . ResolveOptions = {
3939 mainFields : [ 'esm2017' , 'module' , 'main' ]
4040 } ;
4141
@@ -71,15 +71,15 @@ export async function bundleWithWebpack(
7171 }
7272
7373 // Hack to get string output without reading the output file using an internal API from webpack
74- res ( stats . compilation . assets [ outputFileName ] . _value ) ;
74+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
75+ res ( ( stats ! . compilation . assets [ outputFileName ] as any ) [ '_value' ] ) ;
7576 } ) ;
7677 } ) ;
7778}
7879
79- function getMemoryFileSystem ( ) : webpack . OutputFileSystem {
80+ function getMemoryFileSystem ( ) : IFs {
8081 const fs = createFsFromVolume ( new Volume ( ) ) ;
8182 // eslint-disable-next-line @typescript-eslint/no-explicit-any
8283 ( fs as any ) . join = path . join . bind ( path ) ;
83-
84- return ( fs as unknown ) as webpack . OutputFileSystem ;
84+ return fs ;
8585}
0 commit comments