How to resolve error "Cannot find name '_' " using lodash in angular2 app with webpack
<p>Here's how I import lodash in typescript/angular2 app using webpack:</p>

<ul>
<li>$ npm install lodash --save</li>
<li>$ typings install dt~lodash --save</li>
</ul>

<p>In webpack.config.js:</p>

<pre><code>module.exports = {
   plugins: [  
      new ProvidePlugin({
         '_' : 'lodash'
</code></pre>

<p>And it works. </p>

<p>But there's still an error in my editor (Sublime) and in the terminal on runtime : Cannot find name '_'</p>

<p>So, what I'm missing?</p>

<p>In the .ts file where i use lodash I tried to declare it like so:</p>

<pre><code>declare var _ : LoDashStatic
</code></pre>

<p>with no luck.</p>