title: Webpack 4. Set 'mode' option to 'development' or 'production' to enable defaults for this environment
body: <p>I have begin receive an error from webpack after update from webpack 3 to webpack 4 version - </p>
  
  <p><code>WARNING in configuration
  The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.</code></p>
  
  <p>My current config is looks like below. What's I makes wrong?</p>
  
  <pre><code>config.globals = {
    'process.env': {
      NODE_ENV: JSON.stringify(config.env)
    },
    NODE_ENV: config.env,
    __DEV__: config.env === 'development',
    __PROD__: config.env === 'production',
    __TEST__: config.env === 'test',
    __BASENAME__: JSON.stringify(process.env.BASENAME || '')
  }
  </code></pre>