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

154
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
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