Browse Source

Fix default-export-2 and default-export-3

gh-335
Oskar Segersvärd 9 years ago
parent
commit
607ba5ce0c
  1. 2
      src/finalisers/es6.js
  2. 2
      src/finalisers/shared/getExportBlock.js

2
src/finalisers/es6.js

@ -47,7 +47,7 @@ export default function es6 ( bundle, magicString ) {
const defaultExport = module.exports.default || module.reexports.default;
if ( defaultExport ) {
exportBlock += `export default ${module.traceExport( 'default' ).name};`;
exportBlock += `export default ${module.traceExport( 'default' ).render( true )};`;
}
if ( exportBlock ) {

2
src/finalisers/shared/getExportBlock.js

@ -1,6 +1,6 @@
export default function getExportBlock ( entryModule, exportMode, mechanism = 'return' ) {
if ( exportMode === 'default' ) {
return `${mechanism} ${entryModule.declarations.default.render( false )};`;
return `${mechanism} ${entryModule.traceExport( 'default' ).render( false )};`;
}
return entryModule.getExports()

Loading…
Cancel
Save