title: Webpack causes syntax error in bundle output
body: <p>I've been struggling for a while now with a problem that I believe is caused by <a href="http://webpack.github.io/" rel="nofollow">Webpack</a>.</p>
  
  <p>Essentially, I have a Node-based app that I'm bundling up with Webpack to serve to the client (it's a ReactJS based app). The problem occured when I installed the <a href="https://github.com/jsoma/tabletop" rel="nofollow">Tabletop</a> NPM package and <code>require</code>d it.</p>
  
  <p>When attempting to load the Webpack-created <code>bundle.js</code> in the browser, I get a syntax error:</p>
  
  <p><code>Uncaught SyntaxError: Unexpected identifier</code> </p>
  
  <p>which is complaining about this line in <code>bundle.js</code>:</p>
  
  <p><code>
  target[capName] = __webpack_require__(387)(""path + '/' + name);
  </code></p>
  
  <p>After some digging, I discover that this line originates from a line in the <a href="https://github.com/hapijs/hoek" rel="nofollow">Hoek</a> library (which is a sub-dependency of Tabletop):</p>
  
  <p><code>
  target[capName] = require(path + '/' + name);
  </code></p>
  
  <p>Clearly, Webpack has done something funky here.</p>
  
  <p>I haven't been able to isolate the cause though. Tabletop includes <a href="https://github.com/jsoma/tabletop/tree/master/examples/nodejs" rel="nofollow">an example</a> of NodeJS usage which I was able to Webpack and run just fine.</p>
  
  <p>I also cloned Hoek and Webpacke'd it without seeing any illegal transformations like the above.</p>
  
  <p>So now, I'm not sure if this is a Webpack, Hoek, or Tabletop issue, that's why I'm posting it here.</p>
  
  <p>I find no related issues, here or on GH.</p>
  
  <p>All help appreciated!</p>