title: Using Bower with Webpack - React
body: <p>To preface, I'm aware that I should probably avoid using Bower and instead use NPM to manage all my JavaScript dependencies. However, I'm working with some legacy code which uses Bower heavily, and until I can move everything over to NPM, I'd like to get a working version of my code base with Bower and Webpack.</p>
  
  <p>That being said, I'm following the configuration setup for using Bower with Webpack from the official guide: <a href="https://webpack.github.io/docs/usage-with-bower.html" rel="nofollow">https://webpack.github.io/docs/usage-with-bower.html</a></p>
  
  <p>In particular, I've set up a Github repo where I was able to <code>bower install jquery</code> and using the configuration from the official guide, I was able to <code>require("jquery")</code> in my source code and have it work with Webpack. Given that this worked for jQuery, I assumed that it would work for other bower packages, including React.</p>
  
  <p>However, after running <code>bower install react</code>, I attempted to <code>require("react")</code> in my source code but Webpack threw an error saying, <code>Module not found: Error: Cannot resolve module 'react' in /Users/wmock/Desktop/using-bower-with-webpack/src</code>.</p>
  
  <p><strong>This is my Github repo:</strong> <a href="https://github.com/fay-jai/Using-Bower-Through-Webpack" rel="nofollow">https://github.com/fay-jai/Using-Bower-Through-Webpack</a></p>
  
  <p>I have 3 branches:</p>
  
  <ol>
  <li>The "jquery-working" branch follows the configuration from the official guide and works with jQuery installed via Bower. </li>
  <li>The "jquery-react-not-working" branch is the same configuration as above but with React installed via Bower. <strong>This doesn't work.</strong></li>
  <li>The "master" branch has a working version for both jQuery and React installed via Bower, BUT it doesn't follow the configuration setup specified in the official Webpack documentation. </li>
  </ol>
  
  <p><strong>Question:</strong></p>
  
  <ol>
  <li>Is there a way to get the "jquery-react-not-working" branch to work? In other words, is there a way to follow the official documentation and have bower packages like React work with Webpack?</li>
  <li>Are there any drawbacks to using the approach specified in the "master" branch? Should this be the more preferred way to use Bower with Webpack?</li>
  </ol>
  
  <p><strong>EDIT (4/12/2016):</strong></p>
  
  <ol>
  <li>It seems like the DirectoryDescriptionFilePlugin can't handle an array of filenames which is why the "jquery-react-not-working" branch doesn't work.</li>
  <li>I'd love to hear more answers for my 2nd question but my gut tells me that using the approach specified in the "master" branch will not be ideal because: a) you have to manually alias each library and b) you might run into version conflicts if multiple libraries use the same underlying libraries as well.</li>
  </ol>