title: Setting environment variables in package.json scripts under Windows
body: <p>You can set environment variables in Windows with the "SET" command:</p>
  
  <pre><code>set NODE_ENV=production
  </code></pre>
  
  <p>And you can specify short scripts in a package.json file:</p>
  
  <pre><code>"scripts": {
      "buildDev": "set NODE_ENV=development &amp;&amp; webpack",
      "buildProd": "set NODE_ENV=production &amp;&amp; webpack",
  }
  </code></pre>
  
  <p>These work perfectly except for one thing: the value of <code>NODE_ENV</code> when webpack begins executing my config file is <code>"development "</code> - note the trailing space.</p>
  
  <p>This prevents my config file from detecting the correct environment (via <code>process.env.NODE_ENV</code>) and returning the appropriate configuration.</p>