title: Working with breeze and requireJS
body: <p>So there have been similar questions floating around, but I am hoping to get an up-to-date answer on this.</p>
  
  <p>Versions-</p>
  
  <p>breeze: 1.4.0
  Knockout: 2.2.1
  RequireJS: 2.1.5 </p>
  
  <p>I am trying to load breeze in a requireJS project with knockoutJS. Our requireJS config is very simple-</p>
  
  <pre><code>  require.config({
      waitSeconds: 15,
      paths: {
  
          'templates': "/ist-common/templates",
          'lib': '/ist-common/js/lib',
          'ist': '/ist-common/js/ist'
      }
  
  });
  </code></pre>
  
  <p>So I loaded the breeze libs into the following directory structure-</p>
  
  <p>lib<br>
  ---->q.js<br>
  ---->breeze.debug.js<br></p>
  
  <p>I am trying to define a "dataservice" module to use breeze and set it up like so-</p>
  
  <pre><code>define(['lib/knockout', 'lib/q', 'lib/breeze.debug'], function (ko, Q, breeze) {
  
  
      var serviceName = '/ist/rest'; // route to the endpoint
  
      var manager = new breeze.EntityManager(serviceName);
      manager.enableSaveQueuing(true);
  
  
      var query = new EntityQuery("missions");
      manager.executeQuery(query, function(data) {
  
          console.log("success");
  
      });
  
  
  });
  </code></pre>
  
  <p>Is this configuration possible? I am trying to keep my scripts tags down to a minimum and load only requireJS and then load knockout, jquery etc. as I need them inside my module definitions.</p>
  
  <p>This config currently fails with a message- </p>
  
  <blockquote>
    <p>Error: Unable to initialize Q. See <a href="https://github.com/kriskowal/q" rel="nofollow">https://github.com/kriskowal/q</a></p>
  </blockquote>
  
  <p>EDIT*</p>
  
  <p>I was able to get it to load Q with the following config for require, however this feels wrong. Why should I be setting window.Q? Shouldn't I be able to access Q as a named module?</p>
  
  <pre><code> var require = {
      waitSeconds: 15,
      deps: ["/ist-common/js/lib/q.js"],
      callback: function(Q){
          window.Q = Q;
      },
      paths: {
  
          'templates': "/ist-common/templates",
          'lib': '/ist-common/js/lib',
          'ist': '/ist-common/js/ist'
      }
  
  };
  </code></pre>