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; const defaultExport = module.exports.default || module.reexports.default;
if ( defaultExport ) { if ( defaultExport ) {
exportBlock += `export default ${module.traceExport( 'default' ).name};`; exportBlock += `export default ${module.traceExport( 'default' ).render( true )};`;
} }
if ( exportBlock ) { if ( exportBlock ) {

2
src/finalisers/shared/getExportBlock.js

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

Loading…
Cancel
Save