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

359
Vistas
Why there are separate CJS entry points (dev/prod) in React based on NODE_ENV?

When you install React in a project and look at the library code. The main (CJS) entry point is a file with the following content:

'use strict';

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = require('./cjs/react.development.js');
}

Obviously, when we do react-scripts start we load the react.development.js. When we create a production build of our app with react-scripts build, the webpack could still use the react.development.js file and minify it itself.

I assume that NODE_ENV is still development when we run react-scripts build.

If we're using the react.development.js all the time, then what is the point of having these two separate files?

There are many other libraries (like React) using this approach but I cannot understand why are they doing it.

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