@@ -46,8 +46,8 @@ function makeExternalMatcher(obj) {
46
46
47
47
class LegacyResolver extends DefaultResolver {
48
48
49
- constructor ( builtinModules , checkPath , globalPaths , pathContext , customResolver , hostRequire , compiler , externals , allowTransitive ) {
50
- super ( builtinModules , checkPath , globalPaths , pathContext , customResolver , hostRequire , compiler ) ;
49
+ constructor ( builtinModules , checkPath , globalPaths , pathContext , customResolver , hostRequire , compiler , strict , externals , allowTransitive ) {
50
+ super ( builtinModules , checkPath , globalPaths , pathContext , customResolver , hostRequire , compiler , strict ) ;
51
51
this . externals = externals ;
52
52
this . currMod = undefined ;
53
53
this . trustedMods = new WeakMap ( ) ;
@@ -282,7 +282,8 @@ function resolverFromOptions(vm, options, override, compiler) {
282
282
root : rootPaths ,
283
283
resolve : customResolver ,
284
284
customRequire : hostRequire = defaultRequire ,
285
- context = 'host'
285
+ context = 'host' ,
286
+ strict = true ,
286
287
} = options ;
287
288
288
289
const builtins = genBuiltinsFromOptions ( vm , builtinOpt , mockOpt , override ) ;
@@ -325,7 +326,7 @@ function resolverFromOptions(vm, options, override, compiler) {
325
326
}
326
327
327
328
if ( typeof externalOpt !== 'object' ) {
328
- return new DefaultResolver ( builtins , checkPath , [ ] , ( ) => context , newCustomResolver , hostRequire , compiler ) ;
329
+ return new DefaultResolver ( builtins , checkPath , [ ] , ( ) => context , newCustomResolver , hostRequire , compiler , strict ) ;
329
330
}
330
331
331
332
let transitive = false ;
@@ -336,7 +337,7 @@ function resolverFromOptions(vm, options, override, compiler) {
336
337
transitive = context === 'sandbox' && externalOpt . transitive ;
337
338
}
338
339
externals = external . map ( makeExternalMatcher ) ;
339
- return new LegacyResolver ( builtins , checkPath , [ ] , ( ) => context , newCustomResolver , hostRequire , compiler , externals , transitive ) ;
340
+ return new LegacyResolver ( builtins , checkPath , [ ] , ( ) => context , newCustomResolver , hostRequire , compiler , strict , externals , transitive ) ;
340
341
}
341
342
342
343
exports . resolverFromOptions = resolverFromOptions ;
0 commit comments