How can I reference images outside sourceCodeDir? #460
Unanswered
adamreisnz
asked this question in
Q&A
Replies: 1 comment
-
That's the recommended approach.
It's an unusual configuration, but as mentioned in <%= vite_image_tag '/assets/images/test.svg' %> Otherwise, it will attempt to resolve to the Regarding JS imports, read about Import Aliases and the example in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I figured I'd open a new question as the old item is already marked as answered, so not getting a lot of traction.
Could someone please provide a concrete working example for how to get images working from the
/app/assets/images
folder when thesourceCodeDir
is/app/javascript
, in a Rails project?I have tried a lot of different things, but can't seem to get it to work unless I move the images into the
/app/javascript
folder.vite.json
Note: I have tried this with or without the
additionalEntryPoints
Image tags
This is not working
Direct import
This is not working, unless using a resolve alias
Any suggestions would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions