In a React Native (Expo) project, created with create-react-native-app
, I want to add some non-JS files, which will be transpiled1 to JS, to be included in the regular codebase of the project.
Now, I'd like to have the normal npm start
task treat the non-JS files as "first class" part of the project — specifically:
- auto-detect changes in the non-JS source files;
- after the changes are detected, run an extra "build" script which would transpile1 the non-JS sources to
.js
files; - finally, bundle the resulting
.js
files (coming from the transpilation1) together with the rest of the "normal" JS files, and send/serve them to the Expo client.
In other words, I'd like to be able to write/modify my non-JS code with similar ease of use and fast feedback loop as when I write/modify the JS code in the project.
How can I configure such behavior in a CRNA project?
Is it even possible? If I understand correctly, I'd prefer not to "eject" the project, as I don't want to lose the automation etc. of a CRNA project. (Such stuff is being lost during "ejection", no?)
1 a.k.a. compiled, compile, ...