Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Vue Js images are not copied to dist during build process

In a VueJs 3 project I have a list of PNG images. I put the PNG images under src/assets/pngs/. In my Vue componente I build the list with a For loop and put the image name in the img src. In dev mode this works fine.

<div v-for="item in items" :key="item.id">
    <div class="card">
        <p class="hint">{{ item.name }}</p>
        <img :src="makeImgPath(item.img_name)" alt="">
    </div>
</div>
methods: {
  makeImgPath(imgName) {
    return '/src/assets/pngs/' + imgName + '.png';
  }
}

When I build the application with npm run build I get a 404 for all images in the list when built. I have also noticed that the pngs folder and therefore the images are not copied to dist/asstes/. Why is this so and what can I do so that the pictures are copied to the dist folder. Thanks in advance, Max.

almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!