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

68
Vistas
webpack 5 unable to display images on website

Today I am using webpack 5 for a simple website, and I would like to import some images.

However I have run into a problem that I thought would be an easy fix however I ended up sending 4 hours googling to no avail.

I try to put in the image like this. But it doesn't work.

        <img src="../static/test.svg" alt="">

My webpack config contains this...

        test: /\.(jpg|png|gif|svg)$/,
        use: [
          {
            loader: 'file-loader',
            options: {
              outputPath: 'assets/images/',
            },
          },
        ],
      },

After the hours of googling I saw someone say that I must import the photo so I did this in the main.js file I have..

import Icon from '../static/images/test.svg';

But for the life of me I can't figure out how to put it into the HTML part of the website... someone please help. Also I'm not using react.

about 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