File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
test/statsCases/tree-shaking Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -922,19 +922,30 @@ class Stats {
922922 if ( module . usedExports !== undefined ) {
923923 if ( module . usedExports !== true ) {
924924 colors . normal ( prefix ) ;
925- if ( module . usedExports === null )
925+ if ( module . usedExports === null ) {
926926 colors . cyan ( "[used exports unknown]" ) ;
927- else if ( module . usedExports === false )
927+ } else if ( module . usedExports === false ) {
928928 colors . cyan ( "[no exports used]" ) ;
929- else if (
929+ } else if (
930930 Array . isArray ( module . usedExports ) &&
931931 module . usedExports . length === 0
932- )
932+ ) {
933933 colors . cyan ( "[no exports used]" ) ;
934- else if ( Array . isArray ( module . usedExports ) )
935- colors . cyan (
936- `[only some exports used: ${ module . usedExports . join ( ", " ) } ]`
937- ) ;
934+ } else if ( Array . isArray ( module . usedExports ) ) {
935+ const providedExportsCount = Array . isArray ( module . providedExports )
936+ ? module . providedExports . length
937+ : null ;
938+ if (
939+ providedExportsCount !== null &&
940+ providedExportsCount === module . usedExports . length
941+ ) {
942+ colors . cyan ( "[all exports used]" ) ;
943+ } else {
944+ colors . cyan (
945+ `[only some exports used: ${ module . usedExports . join ( ", " ) } ]`
946+ ) ;
947+ }
948+ }
938949 newline ( ) ;
939950 }
940951 }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ bundle.js 7.27 KiB 0 [emitted] main
66Entrypoint main = bundle.js
77 [0] ./a.js 13 bytes {0} [built]
88 [exports: a]
9- [only some exports used: a ]
9+ [all exports used]
1010 [1] ./b.js 13 bytes {0} [built]
1111 [exports: b]
1212 [no exports used]
You can’t perform that action at this time.
0 commit comments