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

153
Vistas
What does the mode parameter do in the webpack.config.js file?

I am working on a project using Webpack, and I happened to notice a parameter in the object called mode.

According to the documentation, it has two possible values (both are a string). One is development, and the other is production.

Below is a part of my webpack.config.js file.

module.exports = {
  mode: "development",
};

I can already infer that development will be slower, and production will be faster. However, what makes the code slower in development?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

production mode used to optimize all JS files, whereas development mode keeps the JS file as it.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Below are the differences of what Webpack compiles your code to depending on your mode.

The development mode

This mode uses the eval() function to execute all of your code in a string. It does not make it smaller, except for the fact that it places all of your code on one line.

The eval() function is slower then normal JavaScript (quote from MDN below), so it is not recommended to use this in production!

From MDN:

eval() is also slower than the alternatives, since it has to invoke the JavaScript interpreter, while many other constructs are optimized by modern JS engines.

The production mode

In production mode, Webpack will properly make your code much smaller in size (without using the eval() function).

Always use this mode in production!

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