Trying to require parts of jquery with webpack
<p>I am <a href="http://alexomara.com/blog/webpack-and-jquery-include-only-the-parts-you-need/" rel="nofollow">using this article</a> to import only the parts of jquery that I would need.</p>

<p>However, I am running into an issue when doing using this code:</p>

<pre><code>let $ = require('jquery/src/core');
require('jquery/src/core/init');
require('jquery/src/css');
console.log($);
</code></pre>

<p>I get this error:</p>

<pre><code>ERROR in ./~/jquery/src/selector-sizzle.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../external/sizzle/dist/sizzle in /home/vamsi/Do/highland-fun/bacon-form/node_modules/jquery/src
 @ ./~/jquery/src/selector-sizzle.js 1:0-14:3
</code></pre>

<p>This is my <code>webpack.config.js</code> file:</p>

<pre><code>module.exports = {
    entry:'./app',
    output:{
      filename:'./bundle'
    },
    modules:{
      loaders:[
        {
           test:/jquery[\\\/]src[\\\/]selector\.js$/,
           loaders:['amd-define-factory-patcher-loader']
        }
      ]
    }
}
</code></pre>

<p>I have tried to use a <code>resolve.alias</code> to fix this:</p>

<pre><code>resolve:{                                                                
  alias:{                                                                
   '../external/sizzle/dist/sizzle':'./node_modules/sizzle/dist/sizzle.js'
  }                                                                      
}
</code></pre>

<p>But it still throws the same error as before.</p>