|
@ -198,9 +198,6 @@ export default class Bundle { |
|
|
return mapSequence( module.sources, source => { |
|
|
return mapSequence( module.sources, source => { |
|
|
return this.resolveId( source, module.id ) |
|
|
return this.resolveId( source, module.id ) |
|
|
.then( resolvedId => { |
|
|
.then( resolvedId => { |
|
|
module.resolvedIds[ source ] = resolvedId; |
|
|
|
|
|
|
|
|
|
|
|
if ( !resolvedId || typeof resolvedId === 'string' ) { |
|
|
|
|
|
let externalName; |
|
|
let externalName; |
|
|
if ( resolvedId ) { |
|
|
if ( resolvedId ) { |
|
|
// If the `resolvedId` is supposed to be external, make it so.
|
|
|
// If the `resolvedId` is supposed to be external, make it so.
|
|
@ -209,7 +206,6 @@ export default class Bundle { |
|
|
// This could be an external, relative dependency, based on the current module's parent dir.
|
|
|
// This could be an external, relative dependency, based on the current module's parent dir.
|
|
|
externalName = resolve( module.id, '..', source ); |
|
|
externalName = resolve( module.id, '..', source ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const forcedExternal = externalName && this.isExternal( externalName ); |
|
|
const forcedExternal = externalName && this.isExternal( externalName ); |
|
|
|
|
|
|
|
|
if ( !resolvedId || forcedExternal ) { |
|
|
if ( !resolvedId || forcedExternal ) { |
|
@ -226,8 +222,6 @@ export default class Bundle { |
|
|
normalizedExternal = resolvedId; |
|
|
normalizedExternal = resolvedId; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// overwrite existing
|
|
|
|
|
|
module.resolvedIds[ source ] = normalizedExternal; |
|
|
module.resolvedIds[ source ] = normalizedExternal; |
|
|
|
|
|
|
|
|
if ( !this.moduleById.has( normalizedExternal ) ) { |
|
|
if ( !this.moduleById.has( normalizedExternal ) ) { |
|
@ -235,16 +229,16 @@ export default class Bundle { |
|
|
this.externalModules.push( module ); |
|
|
this.externalModules.push( module ); |
|
|
this.moduleById.set( normalizedExternal, module ); |
|
|
this.moduleById.set( normalizedExternal, module ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else { |
|
|
if ( resolvedId === module.id ) { |
|
|
if ( resolvedId === module.id ) { |
|
|
throw new Error( `A module cannot import itself (${resolvedId})` ); |
|
|
throw new Error( `A module cannot import itself (${resolvedId})` ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.resolvedIds[ source ] = resolvedId; |
|
|
return this.fetchModule( resolvedId, module.id ); |
|
|
return this.fetchModule( resolvedId, module.id ); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|