title: React-router undefined after concatenation
body: <p><strong>I've set up an app with <a href="http://facebook.github.io/react/" rel="nofollow">react</a> using <a href="https://github.com/rackt/react-router" rel="nofollow">react-router</a> for routing and are having issues bundling it all.</strong></p>
  
  <p>I'm trying to build/bundle all the js files using <a href="https://www.npmjs.com/package/gulp-requirejs" rel="nofollow">gulp-requirejs</a>. But somehow the shim is not included, or the react-router is just ignored. Whatever the problem is, I just end up with an error in the browser console saying <code>Uncaught Error: app missing react-router</code></p>
  
  <p>I'm including the most important code, feel free to ask if something doesn't make sense.</p>
  
  <h1>gulpfile.js</h1>
  
  <p><em><a href="https://github.com/jrburke/almond" rel="nofollow">Almond.js</a> is there to replace requirejs</em></p>
  
  <pre><code>var gulp = require('gulp'),
      uglify = require('gulp-uglify'),
      rjs = require('gulp-requirejs'),
  
  gulp.task('requirejsBuild', function() {
      rjs({
          baseUrl: './app/resources/js/',
          out: 'app.min.js',
          paths: {
              'react': '../bower_components/react/react-with-addons',
              'react-router': '../bower_components/react-router/dist/react-router',
              'react-shim': 'react-shim',
              'jquery': '../bower_components/jquery/dist/jquery'
          },
  
  
          shim: {
              'react-shim': {
                  exports: 'React'
              },
              'react-router': {
                  deps:    ['react-shim']
              }
          },
  
          deps: ['jquery', 'react-router'],
          include: ['init'],
          name: '../bower_components/almond/almond'
      })
      .pipe(uglify()).pipe(gulp.dest('./app/resources/js/'));
  });
  </code></pre>
  
  <h1>init.js</h1>
  
  <pre><code>require.config({
      baseUrl: '/resources/js/',
  
      deps: ['jquery'],
  
      paths: {
          'react': '../bower_components/react/react-with-addons',
          'react-router': '../bower_components/react-router/dist/react-router',
          'react-shim': 'react-shim',
          'jquery': '../bower_components/jquery/dist/jquery'
      },
  
  
      shim: {
          'react-shim': {
              exports: 'React'
          },
          'react-router': {
              deps:    ['react-shim']
          }
      }
  
  });
  
  require(['react', 'app'], function(React, App) {
  
      var app = new App();
      app.init();
  
  });
  </code></pre>
  
  <h1>app.js</h1>
  
  <pre><code>define([
      'react',
      'react-router',
      ], function(
          React,
          Router,
      ){
  
          var Route = Router.Route;
          var RouteHandler = Router.RouteHandler;
          var DefaultRoute = Router.DefaultRoute;
  
          /**
          * Wrapper for it all
          *
          * @type {*|Function}
          */
  
          var Wrapper = React.createClass({displayName: "Wrapper",
              mixins: [Router.State],
  
              render: function() {
                  return (
                      React.createElement(RouteHandler, null)
                      );
              }
          });
  
          var routes = (
              React.createElement(Route, {handler: Wrapper, path: "/"}, null)
              );
  
          var App = function(){};
          App.prototype.init = function () {
              Router.run(routes, Router.HistoryLocation, function (Handler) {
                  React.render(React.createElement(Handler, null), document.getElementById('content'));
              });
          };
          return App;
      }
  );
  </code></pre>
  
  <h1>index.html</h1>
  
  <p><em>Mainly containing a script tag</em></p>
  
  <p>After build you have to manually swap the src with app.min.js </p>
  
  <pre><code>&lt;script data-main="/resources/js/init" src="/resources/bower_components/requirejs/require.js"&gt;&lt;/script&gt;
  </code></pre>