@@ -157,7 +157,7 @@ Deps.prototype.resolve = function (id, parent, cb) {
157
157
if ( opts . extensions ) parent . extensions = opts . extensions ;
158
158
if ( opts . modules ) parent . modules = opts . modules ;
159
159
160
- self . resolver ( id , parent , function onresolve ( err , file , pkg ) {
160
+ self . resolver ( id , parent , function onresolve ( err , file , pkg , fakePath ) {
161
161
if ( err ) return cb ( err ) ;
162
162
if ( ! file ) return cb ( new Error (
163
163
'module not found: "' + id + '" from file '
@@ -171,11 +171,12 @@ Deps.prototype.resolve = function (id, parent, cb) {
171
171
if ( ! p . __dirname ) p . __dirname = path . dirname ( file ) ;
172
172
self . pkgCache [ file ] = p ;
173
173
onresolve ( err , file , opts . packageFilter
174
- ? opts . packageFilter ( p , p . __dirname ) : p
174
+ ? opts . packageFilter ( p , p . __dirname ) : p ,
175
+ fakePath
175
176
) ;
176
177
} ) ;
177
178
}
178
- else cb ( err , file , pkg ) ;
179
+ else cb ( err , file , pkg , fakePath ) ;
179
180
} ) ;
180
181
} ;
181
182
@@ -194,6 +195,7 @@ Deps.prototype.readFile = function (file, id, pkg) {
194
195
} ;
195
196
196
197
Deps . prototype . getTransforms = function ( file , pkg , opts ) {
198
+ // TODO: Needs FAKE path here.
197
199
if ( ! opts ) opts = { } ;
198
200
var self = this ;
199
201
@@ -308,7 +310,7 @@ Deps.prototype.walk = function (id, parent, cb) {
308
310
this . inputPending ++ ;
309
311
}
310
312
311
- self . resolve ( id , parent , function ( err , file , pkg ) {
313
+ self . resolve ( id , parent , function ( err , file , pkg , fakePath ) {
312
314
if ( rec . expose ) {
313
315
// Set options.expose to make the resolved pathname available to the
314
316
// caller. They may or may not have requested it, but it's harmless
@@ -363,7 +365,7 @@ Deps.prototype.walk = function (id, parent, cb) {
363
365
if ( c ) return fromDeps ( file , c . source , c . package , Object . keys ( c . deps ) ) ;
364
366
365
367
self . readFile ( file , id , pkg )
366
- . pipe ( self . getTransforms ( file , pkg , {
368
+ . pipe ( self . getTransforms ( fakePath || file , pkg , {
367
369
builtin : has ( parent . modules , id )
368
370
} ) )
369
371
. pipe ( concat ( function ( body ) {
0 commit comments