Now, to actually generate this file, I’d make a node script (and accompanying package.json run script) that uses fs.readdir to figure out what the paths are statically, then just build a string that looks roughly similar to the export default I have above.
For added benefit, I’m a fan of running my generated code through require('prettier').format.
Thanks for the reply, I have already tried your method before posting. fs.readdir is not supported within react-native application since react-native is not a node.js.
Unless, assuming that you have already made this method working in production, I think (correct me if I am wrong) running a script from package.json runs on node.js?