title: optimizing a javascript file with r.js
body: <p>I use 3rd party libraries which looks like the following</p>
  
  <pre><code>(function ($) {
  
  ....
  
  })(jQuery);
  </code></pre>
  
  <p>I have entries for this js in my config.js </p>
  
  <pre><code>paths : {
  'someLibrary' : 'path/to/someLibrary',
  },
  
  shim : {
  'someLibrary' : { deps: ['jquery'] }
  }
  </code></pre>
  
  <p>It works fine without r.js optimizer, but once I run the optimizer,<br>
  I get error, because of the <code>jQuery is not defined</code> in the library code.</p>
  
  <p>How do I resolve this?</p>
  
  <p><strong>edit</strong></p>
  
  <p>My r.js build file has mainConfigFile set. </p>