diff --git a/README.md b/README.md index 8b169e2..37c43ed 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,28 @@ # Heroku Playwright Buildpack -This buildpack installs all the needed dependencies to use Playwright with Chromium and Firefox on Heroku. +This buildpack installs all of the necessary dependencies to use Playwright with Chromium and Firefox on Heroku. [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/mxschmitt/heroku-playwright-example) ## Usage -For using this buildpack, you have to add the buildpack **before** installing your Node.js dependencies. +To use this buildpack, you must add the buildpack **before** installing your Node.js dependencies. ```txt heroku buildpacks:set https://github.com/mxschmitt/heroku-playwright-buildpack.git -a my-app ``` -For a full example, see [here](https://github.com/mxschmitt/heroku-playwright-example) a usage with the Express library. +For a full example, see [here](https://github.com/mxschmitt/heroku-playwright-example). -It's common to use the `PLAYWRIGHT_BUILDPACK_BROWSERS` environment variable which accepts a comma-separated list of the browser names (`chromium`, `firefox`, `webkit`). By default, it's installing the dependencies for all the browsers. To only install Chromium dependencies for example, just set it to `chromium`. This will reduce the slug size in the end too. +It's common to use the `PLAYWRIGHT_BUILDPACK_BROWSERS` environment variable, which accepts a comma-separated list of the browser names (`chromium`, `firefox`, `webkit`). By default, it installs the dependencies for all of the browsers. To only install Chromium dependencies, for example, just set it to `chromium`. This approach will reduce the slug size. -You should also install the browser specific NPM packages like `playwright-chromium.` to reduce the slug size. +You should also install the browser-specific NPM packages like `playwright-chromium` to reduce the slug size. ## Examples ### Chromium -For using Chromium, it's **necessary** to use `chromiumSandbox: false` in the launch options, since on Heroku is no support for the Chromium sandbox. +To use Chromium, it's **necessary** to use `chromiumSandbox: false` in the launch options because Heroku does not support the Chromium sandbox. ```javascript const { chromium } = require("playwright-chromium"); @@ -39,7 +39,7 @@ const { chromium } = require("playwright-chromium"); ### Firefox -For Firefox, you can refer to the official examples, no need to adjust any configurations. +For Firefox, you can refer to the official examples; no need to adjust any configurations. ```javascript const { firefox } = require("playwright-firefox"); @@ -54,9 +54,9 @@ const { firefox } = require("playwright-firefox"); })(); ``` -## Best practises +## Best practices -It's common to only install the [browser-specific NPM packages](https://playwright.dev/#version=v1.1.1&path=docs%2Finstallation.md&q=download-single-browser-binary), which will reduce installation time and slug size on Heroku in the end, that should fix also the error that the slug size is too large. +It's common to only install the [browser-specific NPM packages](https://playwright.dev/#version=v1.1.1&path=docs%2Finstallation.md&q=download-single-browser-binary), which will reduce installation time and slug size on Heroku in the end. It should reduce the slug size. If you encounter this error at runtime, it means that you are missing the chromium binary, which can be installed with `playwright install chromium`. @@ -72,7 +72,7 @@ browserType.launch: Executable doesn't exist at /app/node_modules/playwright-cor ╚═════════════════════════════════════════════════════════════════════════╝ ``` -You can incorporate this into Heroku's build step by including this script in `package.json`. +You can incorporate it into Heroku's build step by including this script in the `package.json` file. ``` "scripts": {