Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nvh95/netlify-plugin-playwright-cache
🤖 Persist the Playwright executable between Netlify builds
https://github.com/nvh95/netlify-plugin-playwright-cache
ci continuous-integration netlify netlify-plugins playwright
Last synced: about 2 months ago
JSON representation
🤖 Persist the Playwright executable between Netlify builds
- Host: GitHub
- URL: https://github.com/nvh95/netlify-plugin-playwright-cache
- Owner: nvh95
- License: mit
- Created: 2022-09-07T15:44:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-08T15:52:53.000Z (over 2 years ago)
- Last Synced: 2024-10-14T08:34:26.307Z (2 months ago)
- Topics: ci, continuous-integration, netlify, netlify-plugins, playwright
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤖 Netlify Plugin Playwright Cache
[![npm version](https://img.shields.io/npm/v/netlify-plugin-playwright-cache)](https://www.npmjs.com/package/netlify-plugin-playwright-cache)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)Persist the Playwright executables between Netlify builds.
## Why `netlify-plugin-playwright-cache`
When you install `playwright-chromium`, it downloads Chromium executables to a cache folder (not `node_modules`). Netlify does not cache this folder between builds, but caches `node_modules`. This leads to unsuccessful builds with the following error like this:
```
11:33:48 PM: [: Executable doesn't exist at /opt/buildhome/.cache/ms-playwright/chromium-1019/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
11:33:48 PM: ║ Looks like Playwright Test or Playwright was just installed or updated. ║
11:33:48 PM: ║ Please run the following command to download new browsers: ║
11:33:48 PM: ║ ║
11:33:48 PM: ║ npx playwright install ║
11:33:48 PM: ║ ║
11:33:48 PM: ║ <3 Playwright Team ║
11:33:48 PM: ╚═════════════════════════════════════════════════════════════════════════╝
```This plugins fixes the above issue by caching the Playwright executables (Chromium, ffmpeg...) between builds.
## Installation
You can install `netlify-plugin-playwright-cache` by one of the following ways:
1. Install directly from Netlify Dashboard:
2. Install as a dependency of your project:
```bash
npm install --save-dev netlify-plugin-playwright-cache
# Or
yarn add -D netlify-plugin-playwright-cache
# Or
pnpm add -D netlify-plugin-playwright-cache
```Then update `netlify.toml` to include the plugin:
```toml
[[plugins]]
package = "netlify-plugin-playwright-cache"
```## Usage
Remember to **Clear cache and retry deploy** after adding the plugin.