Skip to content

Commit

Permalink
dont include empty imports for reexported external modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 11, 2017
1 parent 671757e commit cc0e5c7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/finalisers/es.js
Expand Up @@ -46,11 +46,16 @@ export default function es ( bundle, magicString, { intro, outro } ) {
}

return specifiersList
.map( specifiers =>
specifiers.length ?
`import ${specifiers.join( ', ' )} from '${module.path}';` :
`import '${module.path}';`
)
.map( specifiers => {
if ( specifiers.length ) {
return `import ${specifiers.join( ', ' )} from '${module.path}';`
}

return module.reexported ?
null :
`import '${module.path}';`;
})
.filter( Boolean )
.join( '\n' );
})
.join( '\n' );
Expand Down

0 comments on commit cc0e5c7

Please sign in to comment.