Closed jorgtz closed 2 years ago
Hey! Take a look at this project which uses the template - https://github.com/flyerhq/react-native-chat-ui. I have the similar structure (assets inside src
). To include them in the lib I added a compile
script
"compile": "rm -rf lib && tsc -p . && copyup src/assets/*.png lib",
which is being run on every yarn
command
"prepare": "yarn compile",
and I have copyfiles
in the dev dependencies (copyup
command)
and I use relative paths in my src
to access assets, like that require('../../assets/icon-attachment.png')
this way no matter it is a src or lib folder, it will find the resources.
I have the following folder structure:
All the folders and files are being included in the library except the assets and its files. I made no changes to the default package.json, it is like this:
How can I add the missing assets folder? Thanks!