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

108
Vistas
How do I set webpack mode

I'm trying to configure my script (in package.json) in such a way that I can run webpack in production or development mode via cli.

package.json

"scripts": {
"start": "webpack serve",
"build": "webpack --mode=production"

in my webpack.config.js file, I was expecting process.env.NODE_ENV to equal to whatever I set the mode to be. Instead, I keep getting undefined please how can I make it work

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

0

For the Dev Server

First, install webpack-dev-server with following command:

npm install webpack-dev-server

Add following line to the package.json script:

"scripts": {
    "start": "webpack-dev-server --mode development"
}

For Production build Add the following line to the scripts section of package.json:

"build": "node_modules/.bin/webpack --mode production"

The scripts section in package.json with both the dev and production build will look like this:

"scripts": {
    "build": "node_modules/.bin/webpack --mode production",
    "start": "webpack-dev-server --mode development" 
}
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