diff --git a/src/Bundle.js b/src/Bundle.js index 988ef7e..489c45d 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -220,8 +220,7 @@ export default class Bundle { const exportAllModule = this.moduleById.get( id ); keys( exportAllModule.exportsAll ).forEach( name => { if ( name in module.exportsAll ) { - this.onwarn( `A module cannot have multiple exports with the same name ('${name}')` + - ` from ${module.exportsAll[ name ] } and ${exportAllModule.exportsAll[ name ]}` ); + this.onwarn( `Conflicting namespaces: ${module.id} re-exports '${name}' from both ${module.exportsAll[ name ]} (will be ignored) and ${exportAllModule.exportsAll[ name ]}.` ); } module.exportsAll[ name ] = exportAllModule.exportsAll[ name ]; }); diff --git a/test/function/double-named-export-from/_config.js b/test/function/double-named-export-from/_config.js index ee0880f..09cb582 100644 --- a/test/function/double-named-export-from/_config.js +++ b/test/function/double-named-export-from/_config.js @@ -1,15 +1,15 @@ const path = require('path'); const assert = require( 'assert' ); -function normalize( file ) { +function normalize ( file ) { return path.resolve( __dirname, file ).split( '\\' ).join( '/' ); } module.exports = { description: 'throws on duplicate export * from', - warnings(warnings) { - assert.equal( warnings[0], `A module cannot have multiple exports with the same name ('foo')` + - ` from ${normalize( 'foo.js' )} and ${normalize( 'deep.js' )}` ); - assert.equal( warnings.length, 1 ); + warnings ( warnings ) { + assert.deepEqual( warnings, [ + `Conflicting namespaces: ${normalize('main.js')} re-exports 'foo' from both ${normalize('foo.js')} (will be ignored) and ${normalize('deep.js')}.` + ]); } };