@@ -6,9 +6,11 @@ import { createFsFromVolume, Volume } from 'memfs';
66import MiniCssExtractPlugin from '../../src' ;
77
88export default ( fixture , loaderOptions = { } , config = { } ) => {
9+ const { outputFileSystem, ...cnfg } = config ;
10+
911 const fullConfig = {
1012 mode : 'development' ,
11- devtool : config . devtool || false ,
13+ devtool : cnfg . devtool || false ,
1214 context : path . resolve ( __dirname , '../fixtures' ) ,
1315 entry : path . resolve ( __dirname , '../fixtures' , fixture ) ,
1416 output : {
@@ -40,16 +42,18 @@ export default (fixture, loaderOptions = {}, config = {}) => {
4042 chunkFilename : '[id].css' ,
4143 } ) ,
4244 ] ,
43- ...config ,
45+ ...cnfg ,
4446 } ;
4547
4648 const compiler = webpack ( fullConfig ) ;
4749
48- if ( ! config . outputFileSystem ) {
49- const outputFileSystem = createFsFromVolume ( new Volume ( ) ) ;
50+ if ( ! outputFileSystem ) {
51+ const outputFS = createFsFromVolume ( new Volume ( ) ) ;
5052 // Todo remove when we drop webpack@4 support
51- outputFileSystem . join = path . join . bind ( path ) ;
53+ outputFS . join = path . join . bind ( path ) ;
5254
55+ compiler . outputFileSystem = outputFS ;
56+ } else {
5357 compiler . outputFileSystem = outputFileSystem ;
5458 }
5559
0 commit comments