Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept metro bundler config as an argument. #126

Open
Sakethtadimeti opened this issue Mar 9, 2024 · 1 comment
Open

Accept metro bundler config as an argument. #126

Sakethtadimeti opened this issue Mar 9, 2024 · 1 comment

Comments

@Sakethtadimeti
Copy link

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.

@Sakethtadimeti
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant