title: How to bundle each node_module as separate bundle in webpack?
body: <p>I have a React project where we are using many dependencies. I was following <a href="https://hackernoon.com/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758" rel="nofollow noreferrer">this hackernoon post</a> in which the author mentions how to split each <code>node_module</code> as a separate file as <code>npm-package1.js</code>,  <code>...2.js</code>, etc.</p>
  
  <p>How do I achieve it in my webpack configuration? My current webpack config which I have been trying to tinker with:</p>
  
  <pre><code>const prodWebpackConfig = {
    entry: {  },
    optimization: {
      runtimeChunk: 'single',
      splitChunks: {
        cacheGroups: {
          vendor: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendor',
            chunks: 'initial'
          }
        }
      }
    }
  };
  </code></pre>
  
  <p>I am running this file which always generates app, runtime, styles and vendor.js in my dist. I am not able to see all the NPM packages as bundles. How do I achieve this configuration?</p>