title: Mvc4 bundling, minification and AngularJS services
body: <p>Is there a way to customize the way Asp.Net MVC4 bundling&amp;minification feature minifies the js files?</p>
  
  <p>Meaning, I don't want to completely turn off minification, but "as is" it just breaks AngularJs.</p>
  
  <p>Since AngularJs uses DI and IoC approach for injecting services in controllers, the following:</p>
  
  <pre><code>function MyController($scope) { }
  </code></pre>
  
  <p>Once minified, becomes:</p>
  
  <pre><code>function MyController(n) { }
  </code></pre>
  
  <p>Normally that wouldn't be a problem, but AngularJs uses the parameter names to understand which service to inject. So $scope should remain $scope, as well as any other parameter in angular controllers. Everything else, like local variables, etc, should be minified normally.</p>
  
  <p>I can't find any clear documentation on how to configure Mvc4 minification, and it seems rather dumb for it to be "all or nothing" so I think I'm missing something.</p>
  
  <p>Thanks.</p>