title: Use rollup.js with jQuery adaptor in same file
body: <p>I have the main function to export and the jQuery adaptor in the same file. And I would like to keep them this way.</p>
  
  <p>Is there a way with rollup.js to create the bundle file compatible with AMD, CommonJS and Browsers?</p>
  
  <p>Right now I have this test file:</p>
  
  <pre><code>//src/foo.js
  export default function(){
      function initialise() {
          var TEST = {};
          TEST.version = '1.0.0';
          TEST.hello = function(){
              console.log("hello man!!");
          };
  
          return TEST;
      }
  
      //jQuery adapter
      (function($){
          $.fn.demo = function(options) {
              $.fn.demo.test = 'test';
          };
      })(jQuery);
  
      return initialise;
  };
  </code></pre>
  
  <p>And I tried using this rollup config:</p>
  
  <pre><code>// rollup.config.js
  export default {
    input: 'src/main.js',
    output: {
      file: 'dist/bundle.js',
      format: 'umd',
      globals: {
          $: '$'
      }
    }
  };
  </code></pre>
  
  <p>However I can't seem to have access to <code>$.fn.demo</code>:</p>
  
  <pre><code>// src/main.js
  import jQuery from 'jQuery';
  import pepe from './foo.js';
  
  
  console.log(jQuery);    //&lt;--- undefined
  console.log($);         //&lt;--- undefined
  
  console.log("-- JS--");
  console.log(pepe);      //&lt;---- working fine
  console.log("-- $.fn.demo --");
  console.log($.fn.demo); //&lt;--- undefined
  </code></pre>