mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
10 years ago
5 changed files with 28 additions and 52 deletions
@ -0,0 +1,12 @@ |
|||
export default function getExportBlock ( bundle, exportMode, mechanism = 'return' ) { |
|||
if ( exportMode === 'default' ) { |
|||
return `${mechanism} ${bundle.entryModule.getCanonicalName('default')};`; |
|||
} |
|||
|
|||
return bundle.toExport |
|||
.map( name => { |
|||
const prop = name === 'default' ? `['default']` : `.${name}`; |
|||
return `exports${prop} = ${bundle.entryModule.getCanonicalName(name)};`; |
|||
}) |
|||
.join( '\n' ); |
|||
} |
Loading…
Reference in new issue