title: How do I correctly set up a Marionette EventAggregator as a Require.js module
body: <p>I'm trying to setup a vent/EventAggregator as a separate Require.js module. I am using Marionette 1.0.2 (which I believe has a different implementation than legacy versions pre 1.0.0) with wreqr included: this code is from backbone.marionette.js:-</p>
  
  <pre><code>        // Event Aggregator
  // ----------------
  // A pub-sub object that can be used to decouple various parts
  // of an application through event-driven architecture.
  
  Wreqr.EventAggregator = (function(Backbone, _){
    "use strict";
    var EA = function(){};
  
    // Copy the `extend` function used by Backbone's classes
    EA.extend = Backbone.Model.extend;
  
    // Copy the basic Backbone.Events on to the event aggregator
    _.extend(EA.prototype, Backbone.Events);
  
    return EA;
  })(Backbone, _);
  </code></pre>
  
  <p>When I set up my vent.js module what should it be? Something like this:-</p>
  
  <pre><code>define(['marionette'],function(Marionette){
      return new Marionette.EventAggregator();
  })
  </code></pre>
  
  <p>Also in my require config should I explicitly be including backbone.wreqr.js or not? Or should just the marionette file (see snippet from above) be sufficient?</p>
  
  <p>For reference here is my app.js:-</p>
  
  <pre><code>require.config({
  
      paths : {
          backbone : 'lib/backbone',
          underscore : 'lib/underscore',
          jquery : 'lib/jquery',
          marionette : 'lib/backbone.marionette',
          'backbone.wreqr' : 'lib/backbone.wreqr',
          text : 'lib/text',
          templates : '../templates'
  
      },
      shim : {
          jquery : {
              exports : 'jQuery'
          },
          underscore : {
              exports : '_'
          },
          backbone : {
              deps : ['jquery', 'underscore'],
              exports : 'Backbone'
          },
          marionette : {
              deps : ['jquery', 'underscore', 'backbone'],
              exports : 'Marionette'
          },
          'backbone.wreqr' : {
              deps : ['backbone', 'marionette', 'underscore'],
              exports : 'Wreqr'
          }
      }
  })
  
  require(
      ["jquery",
          "underscore",
          "backbone",
          "marionette",
          "backbone.wreqr",
          "shell/shellapp"
      ],
      function($, _, Backbone, Marionette, Wreqr, ShellApp) {
          $(function() {
             //new ShellApp();
              var shell = ShellApp;
              shell.start();
              trace("shell: "+shell);
          });
      }
  );
  </code></pre>
  
  <p>All help much appreciated!</p>
  
  <p>Much thanks,</p>
  
  <p>Sam</p>
  
  <p><em><strong></em>__<em>_</em>____</strong><em>*</em>*** UPDATE</p>
  
  <p>Thanks to Paul I figured out how to get my vent.js working. FYI I did NOT need to import the wreqr file seperately in the config. Here is the vent.js code:-</p>
  
  <pre><code>define(['backbone', 'marionette'],function(Backbone, Marionette){
      return new Backbone.Wreqr.EventAggregator();
  });
  </code></pre>