Using gatsby-plugin-image with absolute path #30210
Unanswered
belal-mazlom
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I am using gatsby-plugin-alias-imports to have images with absolute path like:
<img class="profile" src={require('@images/my-client-img.jpg')} alt="Image profile" />
Tried to use that for StaticImage but seems that not possible:
<StaticImage class="profile" src={require('@images/my-client-img.jpg')} alt="Image profile" />
I don't want to get back to relative paths like this
../../../../assets/images/my-client-img.jpg
Is there a way or tips for this issue?
Plugins used:
gatsby-plugin-image
https://www.gatsbyjs.com/plugins/gatsby-plugin-image
gatsby-plugin-alias-imports
https://www.gatsbyjs.com/plugins/gatsby-plugin-alias-imports
Environment details:
Beta Was this translation helpful? Give feedback.
All reactions