From 2b4a2b4d8df3bdc88916b374e7ba1956cb558a72 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 4 Oct 2015 16:28:02 -0400 Subject: [PATCH] mark references from entry module export statements --- src/Module.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Module.js b/src/Module.js index f7509d2..e6961a2 100644 --- a/src/Module.js +++ b/src/Module.js @@ -314,6 +314,12 @@ export default class Module { } this.statements.forEach( statement => { + // skip `export { foo, bar, baz }`... + if ( statement.node.type === 'ExportNamedDeclaration' && statement.node.specifiers.length ) { + // ...unless this is the entry module + if ( this !== this.bundle.entryModule ) return; + }; + statement.references.forEach( reference => { const declaration = reference.scope.findDeclaration( reference.name ) || this.trace( reference.name );