title: How to distribute fonts or other static assets with a React component library built using Webpack?
body: <p>I am trying to include some fonts with a component library that I will distribute as an UMD bundle generated with Webpack and installed as an NPM module; the components make use of those fonts. The problem is that URLs pointing to the fonts in the generated bundle are incorrect and result in 404s when the application that uses the library is run.</p>
  
  <p>For example, <code>resolve-url-loader</code> will output a URL of <code>"/myfont.woff"</code>. But of course, that file is not actually available at that URL in the application unless the application that uses it does some configuration to copy that file  and serve it at the expected path.</p>
  
  <p>Is there a way to automatically make these fonts available (i.e., <code>font-face: 'My Font'</code> will work) when an application imports a component from my library, <em>minimizing amount of configuration needed in the application that uses it</em>?</p>
  
  <p>For large files, I don't want to use <code>url-loader</code> and Base 64-encode them and I can't use a CDN.</p>