Browse Source

Merge pull request #137 from Victorystick/export-all-but-not-default

Don't include 'default' export from 'export * from ...'
better-aggressive
Rich Harris 9 years ago
parent
commit
cad9d320f8
  1. 2
      src/Module.js
  2. 2
      test/form/export-all-from-internal/_expected/amd.js
  3. 2
      test/form/export-all-from-internal/_expected/cjs.js
  4. 2
      test/form/export-all-from-internal/_expected/es6.js
  5. 2
      test/form/export-all-from-internal/_expected/iife.js
  6. 2
      test/form/export-all-from-internal/_expected/umd.js

2
src/Module.js

@ -288,7 +288,7 @@ export default class Module {
// bind the name to the other module's reference. // bind the name to the other module's reference.
this.allExportsFrom.forEach( module => { this.allExportsFrom.forEach( module => {
module.exports.getNames().forEach( name => { module.exports.getNames().forEach( name => {
if ( !this.exports.defines( name ) ) { if ( name !== 'default' && !this.exports.defines( name ) ) {
this.exports.bind( name, module.exports.reference( name ) ); this.exports.bind( name, module.exports.reference( name ) );
} }
}); });

2
test/form/export-all-from-internal/_expected/amd.js

@ -2,10 +2,8 @@ define(['exports'], function (exports) { 'use strict';
const a = 1; const a = 1;
const b = 2; const b = 2;
var internal = 42;
exports.a = a; exports.a = a;
exports.b = b; exports.b = b;
exports['default'] = internal;
}); });

2
test/form/export-all-from-internal/_expected/cjs.js

@ -2,8 +2,6 @@
const a = 1; const a = 1;
const b = 2; const b = 2;
var internal = 42;
exports.a = a; exports.a = a;
exports.b = b; exports.b = b;
exports['default'] = internal;

2
test/form/export-all-from-internal/_expected/es6.js

@ -1,6 +1,4 @@
const a = 1; const a = 1;
const b = 2; const b = 2;
var internal = 42;
export { a, b }; export { a, b };
export default internal;

2
test/form/export-all-from-internal/_expected/iife.js

@ -2,10 +2,8 @@
const a = 1; const a = 1;
const b = 2; const b = 2;
var internal = 42;
exports.a = a; exports.a = a;
exports.b = b; exports.b = b;
exports['default'] = internal;
})((this.exposedInternals = {})); })((this.exposedInternals = {}));

2
test/form/export-all-from-internal/_expected/umd.js

@ -6,10 +6,8 @@
const a = 1; const a = 1;
const b = 2; const b = 2;
var internal = 42;
exports.a = a; exports.a = a;
exports.b = b; exports.b = b;
exports['default'] = internal;
})); }));

Loading…
Cancel
Save