title: Webpack plugin to attach static JSON object to output
body: <p>I am trying to write a webpack plugin that will go into a directory containing html files, open each, remove new lines, and generate an object to attach as a static property to my output file (which is a var).</p>
  
  <p>The object would look something like:</p>
  
  <pre><code>{
    htmlFile1: '&lt;p&gt;some html one!&lt;/p&gt;',
    htmlFile2: '&lt;span&gt;some html two!&lt;/span&gt;
  }
  </code></pre>
  
  <p>Then I would like it to be attached to my output like:</p>
  
  <pre><code>App.templates = { .... }
  </code></pre>
  
  <p>The creation of the object is done. I'm just struggling with webpack and figuring out how to attach it to the main object. Should I just write it to disk and require it? Or is there a way to add it to the bundle via the plugin?</p>
  
  <p>I'm using Rivets.js as a template engine and I have not been able to find anything out there that does something like this already.</p>
  
  <p>Also worth noting, all I'm using is webpack and npm. No Grunt/Gulp/etc</p>
  
  <p>Thanks so much!
  Mike</p>