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

221
Vistas
Webpack file-loader not working for images. Creating curropted file and img src is pointed to that file

I am using webpack file-loader to load images into an HTML page. It is generating a corrupted file and using src as that file, in img tag.

this is my setting in webpack.config.js

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

final image tag which is generated

<img src="8c7b2da10ea507a829fd.jpg" alt="">
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

file-loader is deprecated for webpack version 5 so switching to Asset Modules worked, here's the documentation.

Asset Modules

about 4 years ago · Juan Pablo Isaza Denunciar
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