title: Use puppeteer with webpack
body: <p>How can I use puppeteer with webpack? No matter what I try it cannot find it. Here's as far as I got:</p>
  <p>Dependency is installed in package.json:</p>
  <pre><code>npm i puppeteer
  </code></pre>
  <p>In webpack.dev:</p>
  <pre><code>module.exports = {
      // ... I'm skipping over a bunch of stuff here, then:
      externals: {
          puppeteer: require('puppeteer'),
      }
  }\\
  </code></pre>
  <p>Then in my entry file index.js on the client side:</p>
  <pre><code>import puppeteer from 'puppeteer';
  </code></pre>
  <p>Immediately after I run:</p>
  <pre><code>puppeteer.launch();
  </code></pre>
  <p>Only to get this error:</p>
  <pre><code>Uncaught TypeError: Cannot read property 'launch' of undefined
  </code></pre>
  <p>What am I doing wrong? I'm always struggling with using external plugins within webpack.</p>
  <p>Quick update, I tried the webpack.providePlugin and tested it with the jquery library in parallel. The jquery works by following the same logic, but puppeteer still gives me an error:</p>
  <p>In webpack.dev:</p>
  <pre><code>    plugins: [
      new webpack.ProvidePlugin({
          puppeteer: 'puppeteer',
          jQuery: 'jquery'
      })
  </code></pre>
  <p>in index.js:</p>
  <pre><code>import 'puppeteer'
  import 'jquery'
  </code></pre>
  <p>Then I get a bunch of errors such as:</p>
  <pre><code>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js
  Module not found: Error: Can't resolve 'child_process' in 'C:\Users\victo\OneDrive\Desktop\20200307-kino\kino\node_modules\puppeteer\lib\cjs\puppeteer\node'
  errors @ client:159
  eval @ socket.js:47
  sock.onmessage @ SockJSClient.js:67
  EventTarget.dispatchEvent @ sockjs.js:170
  eval @ sockjs.js:888
  SockJS._transportMessage @ sockjs.js:886
  EventEmitter.emit @ sockjs.js:86
  WebSocketTransport.ws.onmessage @ sockjs.js:2962
  client:159 ./node_modules/extract-zip/index.js
  Module not found: Error: Can't resolve 'fs' in 'C:\Users\victo\OneDrive\Desktop\20200307-kino\kino\node_modules\extract-zip'
  </code></pre>