title: How to set up a private shared library of React components with Webpack
body: <p>I have a number of React components that I use in multiple Webpack projects, and I want to share them via NPM.  So naturally I:</p>
  
  <ol>
  <li>put those components into a (private) GitHub repo</li>
  <li>Added that repo to a main project's <code>package.json</code></li>
  <li>So that I could develop on the component library simultaneously, I used <code>npm link</code> to symlink it into my main project.</li>
  </ol>
  
  <p>However, Webpack can't resolve <code>react</code> from my library component files, because there's no <code>node_modules</code> in the library project folder or any of its parents.</p>
  
  <p>I've seen 3rd party React components that were built as a bundle with <code>react</code> in the <code>externals</code> of the Webpack config, but I don't want to build a separate bundle or do anything complicated, I just want to require the raw source for my library components.  Does anyone know how to do that?</p>