Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!