title: webpack how to exclude node_modules except a folder
body: <p>I'm using webpack 4 and I have installed a module with a lot of subfolders, the structure would be:</p>
  
  <p><code>/node_modules/my_main_package/what_i_need_to_include</code></p>
  
  <p>I need to exclude the whole <code>node_modules</code> except <code>what_i_need_to_include</code>. Here is what I tried in my <code>webpack.base.babel</code> so far:</p>
  
  <p>The first approach:</p>
  
  <pre><code>module: {
      rules: [
        {
          test: /\.js$/, 
          exclude: '/node_modules/',
          include: '/node_modules/my_main_package/what_i_need_to_include',
  use: {
            loader: 'babel-loader',
            options: options.babelQuery,
          },
        },
  ...
  </code></pre>
  
  <p>The second approach:</p>
  
  <pre><code>{
    test: /\.js$/, 
    exclude: '/node_modules\/(?!my_main_package/what_i_need_to_include).*/'
     ...
  }
  </code></pre>
  
  <p>both times unsuccessfully.</p>
  
  <p>How can I get this working? What am I doing wrong?</p>