title: How to dynamically add a module/dependency with a webpack plugin?
body: <p>I feel like what i'm trying to achieve isn't that hard.. but the webpack docs are in a serious disarray and I'm burning many hours on this.</p>
  
  <p>How do i inject a "dynamic" module into a webpack build? I want to create this module at build time.</p>
  
  <p>For a simple example how do i inject this string as a new module at build? </p>
  
  <pre><code>"module.exports = new Date();"
  </code></pre>
  
  <p>Then lets say I want that module to have the name <strong>"myDate"</strong></p>
  
  <p>I would very much like any other module in my application to be able to resolve it with:</p>
  
  <pre><code>var myDate = require('myDate');
  </code></pre>
  
  <p>Now this is a very simple example. My purpose will be much more complex and involve reading files to create this "dynamic" module. I'm aware of the define plugin and it unfortunately does not suit my needs.</p>
  
  <p>I would greatly appreciate any help. Thanks.</p>