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

Use vxrn instead of metro to build JS bundle during native build process #66

Closed
zetavg opened this issue Jul 11, 2024 · 2 comments
Closed

Comments

@zetavg
Copy link
Collaborator

zetavg commented Jul 11, 2024

May use a react-native.config.js to override the bundle command of React Native CLI, which is called during the native build process. But this is not ideal since it depends on the order in the user's package.json for our react-native.config.js is read and defines the bundle command before react-native.

Ref: https://gist.github.com/zetavg/eacd8f8e6ec46213570ab6d1431672be

@szymonrybczak
Copy link
Collaborator

Recently for React Native Community CLI project's we've allowed for overriding commands - so right now vxrn should be able to provide a command inside react-native.config.js and it should be called instead of the default one. See here.

Ref: https://gist.github.com/zetavg/eacd8f8e6ec46213570ab6d1431672be

Nice investigation!

@zetavg
Copy link
Collaborator Author

zetavg commented Jul 15, 2024

Thank you @szymonrybczak, for pointing this out, and for your PR which made this possible! 💙

Well, I’m originally thinking about not having the user place a react-native.config.js in their project by themselves but making the vxrn package include a react-native.config.js which overrides the bundle command of react-native automatically. But my understanding is that there isn’t a stable way to override command from another package, if multiple packages defines the same command, the order of they being listed inside the user’s package.json will determine whose will be used.

However, I currently think it’s not bad (or even better) for the user to prepare react-native.config.js by themselves in their project since this will introduce less magic and give the user an idea of how things will work.

We can probably prepare something that the user can do this in their react-native.config.js:

module.exports = {
  commands: [...require('vxrn/rn-commands')]
}

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

3 participants