File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -399,14 +399,14 @@ exports.createResolver = function (options) {
399
399
} ) ;
400
400
modules . forEach ( item => {
401
401
if ( Array . isArray ( item ) ) {
402
- plugins . push (
403
- new ModulesInHierachicDirectoriesPlugin ( "raw-module" , item , "module" )
404
- ) ;
405
402
if ( item . includes ( "node_modules" ) && pnpApi ) {
406
403
plugins . push (
407
404
new PnpPlugin ( "raw-module" , pnpApi , "undescribed-resolve-in-package" )
408
405
) ;
409
406
}
407
+ plugins . push (
408
+ new ModulesInHierachicDirectoriesPlugin ( "raw-module" , item , "module" )
409
+ ) ;
410
410
} else {
411
411
plugins . push ( new ModulesInRootPlugin ( "raw-module" , item , "module" ) ) ;
412
412
}
Original file line number Diff line number Diff line change @@ -172,17 +172,16 @@ describe("pnp", () => {
172
172
}
173
173
) ;
174
174
} ) ;
175
- it ( "should prefer normal modules over pnp resolves " , done => {
175
+ it ( "should prefer pnp resolves over normal modules " , done => {
176
176
pnpApi . mocks . set ( "m1" , path . resolve ( fixture , "pkg" ) ) ;
177
177
resolver . resolve (
178
178
{ } ,
179
179
path . resolve ( __dirname , "fixtures" ) ,
180
180
"m1/a.js" ,
181
181
{ } ,
182
- ( err , result ) => {
183
- if ( err ) return done ( err ) ;
184
- result . should . equal ( path . resolve ( fixture , "../node_modules/m1/a.js" ) ) ;
185
- done ( ) ;
182
+ err => {
183
+ if ( err ) return done ( ) ;
184
+ done ( new Error ( "Resolved by normal modules" ) ) ;
186
185
}
187
186
) ;
188
187
} ) ;
You can’t perform that action at this time.
0 commit comments