Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda