Why is webpack trying to parse every file in my dependency's path?
<p>I have a large project that I've been refactoring to use webpack and ES6 modules. Many of my dependencies are using commonJS or AMD modules, so I'm requiring them the old way.</p>

<p>For example,</p>

<pre><code>const Pikaday = require("pikaday");
</code></pre>

<p>Unfortunately, when I now run</p>

<pre><code>webpack --progress
</code></pre>

<p>it looks like webpack is trying to parse every single file in that path. I get several warnings that look like, for example:</p>

<pre><code>Module parse failed: /path/to/node_modules/pikaday/index.html 
</code></pre>

<p>Eventually, I get the following error:</p>

<pre><code>ERROR in ./~/pikaday/tests/methods.js
Module not found: Error: Cannot resolve module 'expect.js' in 
/Users/myuser/web/myproject/node_modules/pikaday/tests
</code></pre>

<p>I'm getting an error from a tests directory in this dependency, which I obviously don't care about parsing for my bundle. <strong>Why is webpack trying to parse every file in that path, and how do I correct this behavior?</strong></p>

<hr>

<p>For clarity, I'll post the important parts of my webpack.config.js file here.</p>

<pre><code>var webpack = require("webpack");
var path = require("path");

module.exports = {
    entry : {
        main     : './public/src/Main/main.js',   
    },
    output : {
        path        : './public/build',
        filename    : '[name].bundle.js'
    },
    module : {
        loaders : [
            {
                test : /\.json$/,
                loader : 'json'
            },
            {
                test : /\.js$/,
                loader : "babel?presets[]=es2015"
            },
            {
                test    : /\.css$/,
                loaders  : [
                    'style',
                    'css'
                ]
            },
            {
                test: /\.scss$/,
                loaders: ["style", "css", "sass"]
            },
            {
                test    : /\.(svg|jpg|png|jpeg)$/,
                loader  : 'url'
            },
            {
                test : /vendor\/.+\.(jsx|js)$/,
                loader : 'imports?jQuery=jquery,$=jquery,this=&gt;window'
            }
        ]
    },
    "plugins" : [
        new webpack.ProvidePlugin({
            $               : "jquery",
            jQuery          : "jquery",
            "window.jQuery" : "jquery"
        }),
        new webpack.ProvidePlugin({
            $clamp : "clamp-js"
        }),
        new webpack.ProvidePlugin({

        })
    ]
};
</code></pre>