Import an image when `in-source: false`
Closed this issue · 1 comments
More a question than an issue per se.
I use in-source: false
to generate my JS files in a separate lib
folder. I wanted to use an image in my React code. I found in your template that you use @module
to import it like so:
@module("./logo.svg") external logo: string = "default"
but the generated JS code can't find it because it is not in the right folder anymore.
The documentation talks about a loader to solve that kind of issue, but I haven't really been able to understand how to make it work.
So how can I import an image in a .res
file and have the correct path for it in the generated JS file when it lives in a separate lib
folder?
Thanks a lot!
Update: I overlooked the part where I have to put this code in the HTML:
<script type="module">
import "/src/Main.res";
</script>
so everything works fine now!
Thank you for this great plugin!