title: React: Load Component stored on a webserver
body: <p>the main question is: Is there a good way in ReactJs to load a React Component stores on a webserver?</p>
  
  <p>I already reached the goal to do this but I think my way isn't the best.
  Let me explain what I currently do:</p>
  
  <ol>
  <li><p>I have a core project called "dashboard". This core project has the functionality to load javascript via an XHR request. After the request is done, I call window.eval to use this code.</p></li>
  <li><p>I have a module called "todoModule". This module is the component (or project) stored on the webserver. The todoModule will automatically inject his own code into the navigation bar of the "dashboard" project. The bad thing is, that the "todoModule" has bundled a total size of 1.2MB. And this is too large to load it via an XHR request. I do the bundling via webpack. I already externaled React, ReactDOM, ReactRouter and so one, to use the dependencies of the "dashboard" project. But it is always to big. And the "todoModule" can have his own dependencies, which I dont need in the core project.</p></li>
  </ol>
  
  <p>I have an other idea to do this:</p>
  
  <ol>
  <li>Store all dependencies in the core project</li>
  <li>Build the module with babel --outDir ./lib ./src to just compile the Javascript files without dependencies. The compilied files will have a size of 33KB.</li>
  <li>Upload the compilied files on the webserver.</li>
  </ol>
  
  <p>But I don't know how to implement the features, that the module will always use the dependencies of the core project.</p>
  
  <p>Maybe you can help me or give an other solution.
  Thanks</p>
  
  <p>EDIT (Solution):
  It is not possible to load compiled components from a webserver in a good way. My solution is to deploy a reactjs application anywhere and use postrobot (<a href="https://github.com/krakenjs/post-robot" rel="nofollow noreferrer">https://github.com/krakenjs/post-robot</a>) for the communication</p>