require('../css/style.css');

(function(window, document, requirejs, define){
    'use strict';

    // config
    try {
        var config = JSON.parse(
            document.getElementById('data-config').getAttribute('data-config')
        );
        var versions = config.versions;
    } catch (error) {
        // console.log(error);
    }

    /**
     * Require.js config.
     */
    requirejs.config({
        paths: {
            'react': [
                '//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react'] + '/react.min'
            ],
            'react-dom': [
                '//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react-dom'] + '/react-dom.min'
            ],
            'react-router': [
                '//cdnjs.cloudflare.com/ajax/libs/react-router/' + versions['react-router'] + '/ReactRouter.min'
            ]
        }
    });

    /**
     * Client-side mounting.
     */
    document.addEventListener('DOMContentLoaded', function() {
        var client = require('react-engine/lib/client');

        client.boot({
            routes: require('../../routes/Routes'),
            viewResolver: function(viewName) {
                return require('../../views/' + viewName);
            }
        });
    });

})(window, document, window.requirejs, window.define);

@@ -884,17 +884,26 @@
 %0A     * 
-C
+Mount on c
 lient-si
@@ -908,17 +908,8 @@
 side
- mounting
 .%0A  
@@ -922,67 +922,248 @@
     
-document.addEventListener('DOMContentLoaded', function() %7B%0A
+requirejs(%5B'react', 'react-dom'%5D, function(React, ReactDOM) %7B%0A        window.React = React;%0A        window.ReactDOM = ReactDOM;%0A%0A        requirejs(%5B'react-router'%5D, function(ReactRouter) %7B%0A            window.ReactRouter = ReactRouter;%0A%0A    
     
@@ -1215,25 +1215,25 @@
 ient');%0A
-%0A
+ 
         
 client.b
@@ -1224,16 +1224,19 @@
         
+   
 client.b
@@ -1241,16 +1241,20 @@
 .boot(%7B%0A
+    
         
@@ -1309,16 +1309,20 @@
         
+  
+  
 viewReso
@@ -1344,24 +1344,28 @@
 viewName) %7B%0A
+    
             
@@ -1419,25 +1419,45 @@
             
+   
-%7D
+ %7D%0A            %7D);
 %0A        %7D);

Refactor `react-engine` client-side mounting to use Require.js