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

How do I define reporter in metro.config.js? #2020

Closed
zhiqingchen opened this issue Jul 18, 2023 · 5 comments · Fixed by #2024
Closed

How do I define reporter in metro.config.js? #2020

zhiqingchen opened this issue Jul 18, 2023 · 5 comments · Fixed by #2024
Labels
question Further information is requested

Comments

@zhiqingchen
Copy link
Contributor

zhiqingchen commented Jul 18, 2023

Ask your Question

Cli always overrides the definition of reporter, I can't override the reporter in metro.config.js

metro reporter config

https://facebook.github.io/metro/docs/configuration/#reporter

cli override

https://github.com/react-native-community/cli/blob/main/packages/cli-plugin-metro/src/commands/start/runServer.ts#L56-L65

@zhiqingchen zhiqingchen added the question Further information is requested label Jul 18, 2023
@szymonrybczak
Copy link
Collaborator

Hey @zhiqingchen, you can use --customLogReporterPath option to provide path to custom TerminalReporter when starting Metro. Does this solution satisfy you? or do you need to replace the whole reporter in your case?

@zhiqingchen
Copy link
Contributor Author

zhiqingchen commented Jul 18, 2023

@szymonrybczak Thanks for the reply.
I've customized the metro configuration a bit more, and the reporter is logically associated with the cacheStore and server.

https://github.com/NervJS/taro/blob/feat/react-native-72/packages/taro-rn-supporter/src/Support.ts#L85-L107

The --customLogReporterPath option is more difficult for me to use.

@zhiqingchen
Copy link
Contributor Author

Is it possible to not override the reporter when it has been customized by the user?

@szymonrybczak
Copy link
Collaborator

AFAIK you are not able to do that with current implementation. I think we can support this. Mind creating PR with adding this?

@zhiqingchen
Copy link
Contributor Author

ok, i will try

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

Successfully merging a pull request may close this issue.

2 participants