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

281
Vistas
Webpack [contenthash] parse in files

I will do versioning via hashing. And this with Webpack.

Content of: webpack.config.js

...
output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
},
...

webpack generate some files, i think its okay, its a hash... app.d471b97fd69a6837f5bf.js

In my index.html file must replace the filenames to, i do it with "replacer-contenthash-webpack-plugin" Plugin for Webpack. It used the loaderUtils.getHashDigest(buffer) do generate a hash. But its not the same its generate this 174d0b0d04495cf7a970 hash.

Content of: index.html <script src="dist/app.174d0b0d04495cf7a970.js"></script>

how can i fix it? I dont no how webpack generate the hash with [hashcode]. Its not specified.

i have tried, to specified contenthash digest, length and function:

output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
    hashFunction: "md5",
    hashDigest: "hex",
    hashDigestLength: 32
},

and specified the used Webpack extension getHashDigest() so:

getHashDigest(buffer, "md5", "hex", 32)

=> app.54949ecc3046a8e7e56e8d9875970ca2.js but index.html different :( <script src="dist/app.174d0b0d04495cf7a970e84cc9a96cdb.js"></script>

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