title: How to use hammer.js plugins with require.js
body: <p>I am trying to use hammer.js plugins with require.js but I have no luck.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>requirejs.config({
    paths: {
        "jquery": ('__proto__' in {}) ? "lib/zepto" : "lib/jquery",
        "hammer-jquery": "lib/jquery.hammer",
        "hammer-showtouches": "lib/hammer.showtouches",
        "hammer-fakemultitouch": "lib/hammer.fakemultitouch"
    },
    shim: {
        "jquery": {
            exports: "$"
        },
        "hammer-showtouches": {
            deps: [ "hammer-jquery" ],
            exports: "Hammer.plugins.showTouches"
        },
        "hammer-fakemultitouch": {
            deps: [ "hammer-jquery" ],
            exports: "Hammer.plugins.fakeMultitouch"
        }
    },
    waitSeconds: 30
  });
  
  requirejs(["jquery","hammer-jquery","hammer-showtouches","hammer-fakemultitouch"], function ($,Hammer) {
      $(function(){
        if(!Hammer.HAS_TOUCHEVENTS &amp;&amp; !Hammer.HAS_POINTEREVENTS) {
              Hammer.plugins.showTouches();
              Hammer.plugins.fakeMultitouch();
            }
      });
  });
  </code></pre>
  
  <p>And here is the error:</p>
  
  <p>Uncaught TypeError: Cannot read property 'plugins' of undefined hammer.showtouches.js:7</p>
  
  <p>Uncaught TypeError: Cannot read property 'plugins' of undefined require.js:8</p>
  
  <p>Uncaught TypeError: Cannot read property 'plugins' of undefined hammer.fakemultitouch.js:7</p>
  
  <p>Uncaught TypeError: Cannot read property 'plugins' of undefined require.js:8</p>
  
  <p>I have tried to include Hammer in shim config with no luck (It's not necessary beacause last version of jquery.hammer is AMD compatible).</p>