Webpack: -p vs NODE_ENV=production vs process.env.NODE_ENV
<p>I'm having <a href="https://stackoverflow.com/questions/40464929/react-webpack-production-errors">an issue</a> with webpack in production and I'm getting confused with the different ways of running webpack in the production environment (I'm using Windows).</p>

<p>Can someone explain the difference between these:</p>

<p>One: CLI</p>

<ul>
<li><code>webpack -p</code></li>
</ul>

<p>Two: CLI</p>

<ul>
<li><code>SET NODE_ENV=production</code></li>
<li><code>webpack</code></li>
</ul>

<p>Three: webpack.config.js</p>

<pre><code>new webpack.ProvidePlugin({
  'process.env': {
    NODE_ENV: JSON.stringify('production')
  }
})
</code></pre>

<p>I'm using React and need to build a production version which is both minified and includes the production version of React.</p>