Webpack resolve image
See original GitHub issueI am trying to add image to the src attribute, but it’s not working… How does avatar resolve images? I am working with Nuxt.js which uses Webpack to resolve images.
Does not work <avatar src="@/assets/img/profiles/test.png">
works <avatar src="https://eliep.github.io/vue-avatar/static/darth-vader.png">
.
If I do this <img src="@/assets/img/profiles/test.png">
, the image is displayed.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Webpack resolve images in certain directory - Stack Overflow
To reference the images from /src , I have to currently do this: require("../assets/images/some-image.png");. Is there a way that I can simplify ...
Read more >Possible to have image paths resolved using ... - GitHub
In my webpack.config.js resolve: { alias: { // Allow friendly reference ... As it stands my images still need relative paths, to reference ......
Read more >Asset Management - webpack
Now let's try to incorporate some other assets, like images, ... + filename: 'bundle.js', path: path.resolve(__dirname, 'dist'), }, }; ...
Read more >[SOLVED] Image problems after upgrading to Webpack 5 ...
The image problems started with having to change ... So, I'm thinking that Webpack is looking at resolve.extensions for how to load the ......
Read more >image-webpack-loader - npm
image -webpack-loader. Image loader module for webpack. Minify PNG, JPEG, GIF, SVG and WEBP images with imagemin. Issues with the output should ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just in case someone is suffering because of this:
Using require will do the job!
I just checked Nuxt documentation https://nuxtjs.org/guide/assets/ and you can try using the require statement