title: Using Composer to install npm and bower packages on production (i.e. no devDependencies)
body: <p>In my composer.json file I have the following in the scripts section:</p>
  
  <pre><code>    "post-install-cmd": [
          "php artisan clear-compiled",
          "php artisan optimize",
          "npm install",
          "bower install"
      ]
  </code></pre>
  
  <p>When running 'composer install' this will cause npm and bower to install all their dependencies, which by default include devDependencies. When it comes to doing a production rollout (e.g. 'composer install --no-dev' I want to fire up 'npm install --production' and 'bower install --production')</p>
  
  <p>As far as I can tell, there doesn't seem to be a way to either change the list specified for 'post-install-command' depending on flags passed, or a way of setting variables that can then be passed to commands in post-install-cmd.</p>
  
  <p>Am I missing something? It doesn't seem possible to use composer to do both a dev and production install using just the config. Do I really have to use <code>composer install --no-scripts</code> on production and then manually run all four of the commands myself? That seems a little clunky.</p>