title: How to use NPM to package a deployment?
body: <p>I've developed an Angular website that lives in a Node-based project. Gulp is used to build sources into development and production versions of the site. The project includes an ExpressJS server that can serve either the dev or prod versions of the files. <strong>Now I want to build and deploy the site in CI fashion.</strong></p>
  
  <p>I have a private NPM registry that I'm able to publish the entire project module to. The easy route would be:</p>
  
  <ol>
  <li>In the build environment, check out the project repository</li>
  <li><code>npm install</code></li>
  <li>pass tests</li>
  <li><code>npm publish</code></li>
  <li>In the production environment..</li>
  <li><code>npm install project</code></li>
  <li>build for production</li>
  <li>Run the server over the newly built prod files</li>
  </ol>
  
  <p>But this doesn't seem right. Shouldn't I output the production files as part of the build process, and publish <em>these</em> as a versioned artifact with NPM? <strong>Are there acceptable, different ways to publish an NPM module for development and deployment?</strong></p>
  
  <p>Or am I stuck building my sources in the production environment? Doesn't this defeat the purpose of NODE_ENV=production?</p>