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

321
Vistas
How webpack dev vs production builds javascript code?

I'm building an HTML web application and writing all my code in TypeScript. I use webpack to convert the TypeScript to JavaScript and to bundle and minify all my individual source files into one javaScript main.js file.

I'd like to know if the main.js file that I'm running in the browser was generated from a development build using webpack or a production build. How can I do this?

For example, in the webpack development config I do:

new webpack.DefinePlugin( {
  IS_DEBUG_MODE: JSON.stringify( true ),
} ),

How can the compiled main.js file use this information to:

console.log( 'isDebugMode', ?? );

I tried doing process.env.IS_DEBUG_MODE but the browser gives me an error stating that process is not defined.

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

0

Figured out that I can use the html-webpack-plugin with template parameters to pass information from webpack into html.

https://github.com/jantimon/html-webpack-plugin/tree/main/examples/template-parameters

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