Hi, so in React I need to import something that will be in some folder strictly outside the project’s source directory. So, there is no way for me to traditionally import anything from a file in this external folder.
I seem to have bypassed this by creating a symlink directory in my project linking to that folder, and it seems to be working fine. Here are some observations:
- I have not added this symlinked directory into
.meteorignore, because then I can’t import anything from it.
- I have however added it to
.gitignoresince I don’t want that sync’ed to my Github repo. I’m not sure how symlinks would behave when cloning repos etc, I need to read up more about this.
- Meteor does not hot-reload when there are changes in this symlinked directory, and rightfully so. Adding or deleting things from this directory doesn’t trigger a reload.
Is this acceptable practice in the eyes of Meteor, to use resources from a symlinked directory? I’m curious about a few things:
- What does Meteor “see” in this symlinked directory? Does it only see an empty directory, and that’s why it doesn’t hot-reload whenever there are changes in the external directory? Or is this an unintended side-effect of something else?
- This seems to have worked out for me because the contents of this directory can change whenever, and it’s not ideal for Meteor to keep reloading every time there’s a change in it. This seems to be the ideal solution because technically I didn’t have to add it to
.meteorignoreand yet Meteor doesn’t reload when there are changes, so I can use this dynamic content in my app. However it feels a little hacky as I’m not sure if this is an intended feature of symlinks or anything else. Is there anything I should be mindful of with this approach?
Appreciate any insights, thank you.