Proposed change: Accept a `--config` argument & pass it on to react native bundle command. Example usage - `react-native-bundle-visualizer --platform android --config metro+esbuild.config.js` Why is this needed: It'll be easier to view bundle sizes when testing out different configurations of metro config. Ex:: Bundling with es-build /without es-build.
Activity
Sakethtadimeti commentedon Mar 9, 2024
@IjzerenHein Please let me if this makes sense. I'll be happy to send a PR in.
For more context - Esbuild (with tree shaking support) for metro bundler is out in beta.
https://www.npmjs.com/package/@rnx-kit/metro-serializer-esbuild.
There is a known limitation that it only works correctly with production builds & hence needs us to maintain 2 versions of metro config.
While trying to visualize the difference in bundle sizes with & without es-build transformations, we realized doesn't accept a config arg currently.
https://github.com/IjzerenHein/react-native-bundle-visualizer/blob/main/src/react-native-bundle-visualizer.js#L86-#L100