title: using requireJS for plugin that exports multiple function to jquery
body: <p>I'm trying to use requireJS to add <a href="https://code.google.com/p/rangyinputs/downloads/list" rel="nofollow noreferrer">this library/plug-in</a> to jquery. </p>
  
  <p>I've looked at the documentation, and other S.O. questions, and I still can't figure out what's going wrong.</p>
  
  <p>Using backbone and require as an example: 
  I'm pretty sure I need to use shim in my main.js file. 
  I'm also pretty sure that I need to still load the plug-in in the particular file I want to use it in (Even though I don't actually use the rangyInputs object in the body of the function) (which I do for backbone). Really, I just want to bind the functions from the rangyInputs library to jquery once, and then just require jquery in all the files I need those functions. </p>
  
  <pre><code>define([
  'jquery',     
  'underscore', 
  'backbone'    
  , 'views/listView' 
  , 'sockets'
  , 'collections/nodesCollection'
  , 'views/listView'
  , 'models/node'
  , 'rangyInputs' //I define the path to this like I do the path for backbone in main.js
  ], 
  function($, _, Backbone, ListView, io, nodesCollection, listView, nodeModel ,rangyInputs){
  </code></pre>
  
  <p>The un-minified library has this at the end: </p>
  
  <pre><code>$.fn.extend({
          getSelection: jQuerify(getSelection, false),
          setSelection: jQuerify(setSelection, true),
          collapseSelection: jQuerify(collapseSelection, true),
          deleteSelectedText: jQuerify(deleteSelectedText, true),
          deleteText: jQuerify(deleteText, true),
          extractSelectedText: jQuerify(extractSelectedText, false),
          insertText: jQuerify(insertText, true),
          replaceSelectedText: jQuerify(replaceSelectedText, true),
          surroundSelectedText: jQuerify(surroundSelectedText, true)
      });
  </code></pre>
  
  <p>The documentation and gives examples where of using "exports" for shim, but I don't think I can use this since I have multiple things I'm exporting. (and I'm not exactly sure how exports works). </p>
  
  <p>Thanks!</p>
  
  <p>EDIT: I tried applying this solution so that I could include a different plug-in, and it didn't work, so I asked <a href="https://stackoverflow.com/questions/20937259/requirejs-worked-for-one-plug-in-but-not-another">another question here</a></p>