title: Creating bundle that depends on Node.js
body: <p>I am currently bundling several projects and encountered a problem when I included socket.io-client in one of them.</p>
  <p>I get the error:</p>
  <blockquote>
  <p>Creating a browser bundle that depends on Node.js built-in modules ('url', 'tty', 'util', 'os', 'http', 'https', 'events', 'zlib' and 'stream')</p>
  </blockquote>
  <p>It suggests using <a href="https://github.com/ionic-team/rollup-plugin-node-polyfills" rel="nofollow noreferrer">https://github.com/ionic-team/rollup-plugin-node-polyfills</a>
  I did try and encountered another error when it was included:</p>
  <blockquote>
  <p>UnhandledPromiseRejectionWarning: Error: 'Polyfill' is not exported by node_modules/es6-promise-polyfill/promise.js, imported by node_modules/@pixi/polyfill/lib/polyfill.es.js</p>
  </blockquote>
  <p>That error occur if Pollyfills() is the 1st or 2nd plugin, while in the 3rd it acts as though it isn't even there and prints the first error.
  Here is my code:</p>
  <pre><code>function createBundle(slug, destinationPath) {
      const config = {
          input: './apps/' + slug + '/index.js',
          external: builtins,
          preserveEntrySignatures: false,
          plugins: [resolve({preferBuiltins: false}), nodePolyfills(), common()]
  }
  
      console.log('Creating bundle for ' + destinationPath)
      rollup.rollup(config).then((bundle) =&gt; {
          bundle.generate({format: 'iife'}).then((result) =&gt; { //'es' 'cjs' 'amd'
              compileCode('app.js', result.output[0].code, destinationPath);
  
          });
      });
  }
  </code></pre>
  <p>Does anyone have any suggestions or solutions to fix this?</p>