Browse Source

handle re-exports in entry module

contingency-plan
Rich-Harris 9 years ago
parent
commit
840d1dc21d
  1. 30
      src/Statement.js

30
src/Statement.js

@ -263,21 +263,21 @@ export default class Statement {
this.isIncluded = true;
// `export { name } from './other'` is a special case
// if ( this.isReexportDeclaration ) {
// return this.module.bundle.fetchModule( this.node.source.value, this.module.id )
// .then( otherModule => {
// return sequence( this.node.specifiers, specifier => {
// const reexport = this.module.reexports[ specifier.exported.name ];
//
// reexport.isUsed = true;
// reexport.module = otherModule;
//
// return otherModule.isExternal ?
// null :
// otherModule.markExport( specifier.local.name, specifier.exported.name, this.module );
// });
// });
// }
if ( this.isReexportDeclaration ) {
const id = this.module.resolvedIds[ this.node.source.value ];
const otherModule = this.module.bundle.moduleById[ id ];
this.node.specifiers.forEach( specifier => {
const reexport = this.module.reexports[ specifier.exported.name ];
reexport.isUsed = true;
reexport.module = otherModule; // TODO still necessary?
if ( !otherModule.isExternal ) otherModule.markExport( specifier.local.name, specifier.exported.name, this.module );
});
return;
}
Object.keys( this.dependsOn ).forEach( name => {
if ( this.defines[ name ] ) return; // TODO maybe exclude from `this.dependsOn` in the first place?

Loading…
Cancel
Save