Open zetavg opened 1 month ago
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!
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')]
}
May use a
react-native.config.js
to override thebundle
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'spackage.json
for ourreact-native.config.js
is read and defines thebundle
command beforereact-native
.Ref: https://gist.github.com/zetavg/eacd8f8e6ec46213570ab6d1431672be