Skip to content

Commit

Permalink
harmony modules without exports have no exports instead of unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jun 14, 2017
1 parent 7eb7529 commit d6a7594
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/FlagDependencyExportsPlugin.js
Expand Up @@ -19,7 +19,7 @@ class FlagDependencyExportsPlugin {
module = queue[i];

if(module.providedExports !== true) {
moduleWithExports = false;
moduleWithExports = module.meta && module.meta.harmonyModule;
moduleProvidedExports = Array.isArray(module.providedExports) ? new Set(module.providedExports) : new Set();
processDependenciesBlock(module);
if(!moduleWithExports) {
Expand Down
5 changes: 4 additions & 1 deletion lib/Stats.js
Expand Up @@ -641,7 +641,10 @@ class Stats {
const processModuleContent = (module, prefix) => {
if(Array.isArray(module.providedExports)) {
colors.normal(prefix);
colors.cyan(`[exports: ${module.providedExports.join(", ")}]`);
if(module.providedExports.length === 0)
colors.cyan("[no exports]");
else
colors.cyan(`[exports: ${module.providedExports.join(", ")}]`);
newline();
}
if(module.usedExports !== undefined) {
Expand Down
1 change: 1 addition & 0 deletions test/statsCases/tree-shaking/expected.txt
Expand Up @@ -11,6 +11,7 @@ bundle.js 7.33 kB 0 [emitted] main
[2] (webpack)/test/statsCases/tree-shaking/unknown.js 0 bytes {0} [built]
[only some exports used: c]
[3] (webpack)/test/statsCases/tree-shaking/index.js 276 bytes {0} [built]
[no exports]
[4] (webpack)/test/statsCases/tree-shaking/reexport-known.js 49 bytes {0} [built]
[exports: a, b]
[only some exports used: a]
Expand Down

0 comments on commit d6a7594

Please sign in to comment.