Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

74
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda