title: What are the differences between webpack development and production build modes?
body: <p>In Grunt or Gulp, I used to define all the requirements myself, like: stuff should be minified only for production, livereload should be enabled only in dev server.</p>
  
  <p>Webpack handles this on its own, via <a href="https://webpack.github.io/docs/cli.html#development-shortcut-d" rel="noreferrer">its <code>-d</code> and <code>-p</code> options</a>, that toggle the loaders' <code>minimize</code> mode (most loaders ship with their relevant minifiers), the <code>devtool</code> and similar stuff (I don't know what exactly). Most of that "just works".</p>
  
  <p>But on the other hand, there are some libraries that have a development and production mode. For example, React looks at <code>process.NODE_ENV</code>, and if it's <code>production</code>, it <a href="https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html#installation" rel="noreferrer">disables the <code>propTypes</code> checking</a> (which will be later stripped off by minifier as dead code, thus reducing bundle size). In Webpack, a <a href="http://ianobermiller.com/blog/2015/06/15/shave-45kb-off-your-production-webpack-react-build/" rel="noreferrer">common way to do this is to use the <code>DefinePlugin</code></a>.</p>
  
  <p>The problem is, that this plugin should be enabled only in the production build. Some people go as far as <a href="http://www.christianalfoni.com/articles/2015_04_19_The-ultimate-webpack-setup" rel="noreferrer">having 2 separate webpack configs</a> because of that. This seems overkill, since most of the job is already done by webpack. I'd like to avoid this.</p>
  
  <p>To find some better solution, <strong>I'd like to understand what exactly changes</strong> when I use the <code>-d</code> or <code>-p</code> option, and how does it affect all the loaders and plugins. I didn't find it documented anywhere. The existing documentation just mentions "debug mode" or "watch mode" without explaining what does it actually mean.</p>
  
  <p><sub>Note that I'm not asking for a do-this-and-that answer. A good, detailed explanation would be appreciated.</sub></p>