2

I have an express server that runs my app using webpack-dev-middleware and webpack-dev-server.

After updating to webpack@4.1.1 I get the following warning

WARNING in configuration
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.

Since I am not directly running webpack from the CLI how can set the --mode option?

Carloluis
  • 4,205
  • 1
  • 20
  • 25
mancristiana
  • 1,896
  • 3
  • 18
  • 28

1 Answers1

4

The mode option can also be set in the webpack config object:

{
    mode: 'development'
}

More related info configuring Webpack 4 can be found in this webpack-demo

Carloluis
  • 4,205
  • 1
  • 20
  • 25