@@ -6,9 +6,11 @@ import { createFsFromVolume, Volume } from 'memfs';
6
6
import MiniCssExtractPlugin from '../../src' ;
7
7
8
8
export default ( fixture , loaderOptions = { } , config = { } ) => {
9
+ const { outputFileSystem, ...cnfg } = config ;
10
+
9
11
const fullConfig = {
10
12
mode : 'development' ,
11
- devtool : config . devtool || false ,
13
+ devtool : cnfg . devtool || false ,
12
14
context : path . resolve ( __dirname , '../fixtures' ) ,
13
15
entry : path . resolve ( __dirname , '../fixtures' , fixture ) ,
14
16
output : {
@@ -40,16 +42,18 @@ export default (fixture, loaderOptions = {}, config = {}) => {
40
42
chunkFilename : '[id].css' ,
41
43
} ) ,
42
44
] ,
43
- ...config ,
45
+ ...cnfg ,
44
46
} ;
45
47
46
48
const compiler = webpack ( fullConfig ) ;
47
49
48
- if ( ! config . outputFileSystem ) {
49
- const outputFileSystem = createFsFromVolume ( new Volume ( ) ) ;
50
+ if ( ! outputFileSystem ) {
51
+ const outputFS = createFsFromVolume ( new Volume ( ) ) ;
50
52
// Todo remove when we drop webpack@4 support
51
- outputFileSystem . join = path . join . bind ( path ) ;
53
+ outputFS . join = path . join . bind ( path ) ;
52
54
55
+ compiler . outputFileSystem = outputFS ;
56
+ } else {
53
57
compiler . outputFileSystem = outputFileSystem ;
54
58
}
55
59
0 commit comments