@@ -228,13 +228,16 @@ export default class ExportMap {
228
228
if ( this . namespace . has ( name ) ) return true
229
229
if ( this . reexports . has ( name ) ) return true
230
230
231
- for ( let dep of this . dependencies . values ( ) ) {
232
- let innerMap = dep ( )
231
+ // default exports must be explicitly re-exported (#328)
232
+ if ( name !== 'default' ) {
233
+ for ( let dep of this . dependencies . values ( ) ) {
234
+ let innerMap = dep ( )
233
235
234
- // todo: report as unresolved?
235
- if ( ! innerMap ) continue
236
+ // todo: report as unresolved?
237
+ if ( ! innerMap ) continue
236
238
237
- if ( innerMap . has ( name ) ) return true
239
+ if ( innerMap . has ( name ) ) return true
240
+ }
238
241
}
239
242
240
243
return false
@@ -264,18 +267,22 @@ export default class ExportMap {
264
267
return deep
265
268
}
266
269
267
- for ( let dep of this . dependencies . values ( ) ) {
268
- let innerMap = dep ( )
269
- // todo: report as unresolved?
270
- if ( ! innerMap ) continue
271
270
272
- // safeguard against cycles
273
- if ( innerMap . path === this . path ) continue
271
+ // default exports must be explicitly re-exported (#328)
272
+ if ( name !== 'default' ) {
273
+ for ( let dep of this . dependencies . values ( ) ) {
274
+ let innerMap = dep ( )
275
+ // todo: report as unresolved?
276
+ if ( ! innerMap ) continue
277
+
278
+ // safeguard against cycles
279
+ if ( innerMap . path === this . path ) continue
274
280
275
- let innerValue = innerMap . hasDeep ( name )
276
- if ( innerValue . found ) {
277
- innerValue . path . unshift ( this )
278
- return innerValue
281
+ let innerValue = innerMap . hasDeep ( name )
282
+ if ( innerValue . found ) {
283
+ innerValue . path . unshift ( this )
284
+ return innerValue
285
+ }
279
286
}
280
287
}
281
288
@@ -298,16 +305,19 @@ export default class ExportMap {
298
305
return imported . get ( local )
299
306
}
300
307
301
- for ( let dep of this . dependencies . values ( ) ) {
302
- let innerMap = dep ( )
303
- // todo: report as unresolved?
304
- if ( ! innerMap ) continue
308
+ // default exports must be explicitly re-exported (#328)
309
+ if ( name !== 'default' ) {
310
+ for ( let dep of this . dependencies . values ( ) ) {
311
+ let innerMap = dep ( )
312
+ // todo: report as unresolved?
313
+ if ( ! innerMap ) continue
305
314
306
- // safeguard against cycles
307
- if ( innerMap . path === this . path ) continue
315
+ // safeguard against cycles
316
+ if ( innerMap . path === this . path ) continue
308
317
309
- let innerValue = innerMap . get ( name )
310
- if ( innerValue !== undefined ) return innerValue
318
+ let innerValue = innerMap . get ( name )
319
+ if ( innerValue !== undefined ) return innerValue
320
+ }
311
321
}
312
322
313
323
return undefined
@@ -321,7 +331,7 @@ export default class ExportMap {
321
331
callback . call ( thisArg , getImport ( ) . get ( local ) , name , this ) )
322
332
323
333
this . dependencies . forEach ( dep => dep ( ) . forEach ( ( v , n ) =>
324
- callback . call ( thisArg , v , n , this ) ) )
334
+ n !== 'default' && callback . call ( thisArg , v , n , this ) ) )
325
335
}
326
336
327
337
// todo: keys, values, entries?
0 commit comments