Created
June 17, 2020 15:38
-
-
Save jsoverson/43b4176a3ed47baea2653eb4450e5e0b to your computer and use it in GitHub Desktop.
Using [email protected] with typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Puppeteer } from 'puppeteer/lib/Puppeteer'; | |
import findRoot from 'find-root'; | |
import path from 'path'; | |
import { initializePuppeteer } from 'puppeteer/lib/index'; | |
const puppeteer = initializePuppeteer({ | |
packageJson: require(path.join(findRoot(require.resolve('puppeteer')), 'package.json')), | |
rootDirectory: findRoot(require.resolve('puppeteer')), | |
}); | |
export default puppeteer as Puppeteer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment