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

361
Visualizações
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 à 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