IjzerenHein / react-native-bundle-visualizer

See what packages are increasing your react-native bundle size 📦
MIT License
1.43k stars 42 forks source link

fix - verbose bundle size output is no longer [object Object] #97

Closed omerg closed 1 year ago

omerg commented 1 year ago

This fixes the console output of individual file stats when verbose parameter is provided. Prior to the change, size of a file was not printed correctly:

Before: [sourceMappingURL], size: [object Object] bytes

After: [sourceMappingURL], size: 35 bytes

IjzerenHein commented 1 year ago

Fixes #73

hurali97 commented 1 year ago

@omerg Thanks for addressing changes. I notice CI is failing due to node 12 not supporting the optional chaining. Can you re-address and remove the optional chaining operator (?), like so:

Previously: chalk.green(file + ', size: ' + bundle.files[file]?.size + ' bytes')

Now: chalk.green(file + ', size: ' + bundle.files[file].size + ' bytes')

omerg commented 1 year ago

@omerg Thanks for addressing changes. I notice CI is failing due to node 12 not supporting the optional chaining. Can you re-address and remove the optional chaining operator (?), like so:

Previously: chalk.green(file + ', size: ' + bundle.files[file]?.size + ' bytes')

Now: chalk.green(file + ', size: ' + bundle.files[file].size + ' bytes')

Thanks for flagging @hurali97 , chaining operator is removed now 👍