title: Does rollup bundle node_modules into bundle.js?
body: <p>I am testdriving <a href="https://rollupjs.org/#using-rollup-with-npm" rel="noreferrer">rollupjs</a> to package a node app into a <code>bundle.js</code> and am confused.</p>
  
  <blockquote>
    <p>Does rollup support bundling a full node app (including <code>node_modules</code>), or just the js files that are part of your project?</p>
  </blockquote>
  
  <p>I have a standard node project (1 <a href="https://github.com/datproject/dat/blob/master/index.js" rel="noreferrer"><code>index.js</code></a>, thousands of files in <code>node_modules</code>) and would like just one <code>bundle.js</code>. I tried:</p>
  
  <p><em>rollup.config.js</em>:</p>
  
  <pre><code>import commonjs from 'rollup-plugin-commonjs';
  import nodeResolve from 'rollup-plugin-node-resolve';
  
  export default {
  entry: 'index.js',
  dest: 'bundle.js',
  format: 'iife',
  plugins: [
  
      commonjs({
          // non-CommonJS modules will be ignored, but you can also
          // specifically include/exclude files
          include: 'node_modules/**',  // Default: undefined
  
          // if true then uses of `global` won't be dealt with by this plugin
          ignoreGlobal: false,  // Default: false
  
          // if false then skip sourceMap generation for CommonJS modules
          sourceMap: false,  // Default: true
      }),
  
      nodeResolve({
      jsnext: true,
      main: false
      })
  ]
  };
  </code></pre>
  
  <p>Whatever I try <code>rollup</code> turns this <code>index.js</code>:</p>
  
  <pre><code>module.exports = require('dat-node') // 88 MB node_modules
  </code></pre>
  
  <p>with this command:</p>
  
  <pre><code>rollup index.js --format iife --output dist/bundle.js -c
  </code></pre>
  
  <p>to this <code>bundle.js</code> without adding anything from <code>node_modules</code>:</p>
  
  <pre><code>(function () {
  'use strict';
  
  module.exports = require('dat-node');
  
  }());
  </code></pre>
  
  <p>And I have tried:</p>
  
  <ul>
  <li>swapping plugin sequence</li>
  <li>all different command line options</li>
  <li>different formats</li>
  <li>different config file settings</li>
  </ul>
  
  <p>Now I am thinking, maybe I understand rollup incorrectly and it does not support what I want. Help much appreciated!</p>