Skip to content

Commit d56ff48

Browse files
authored
fix(playwright): auto-install Playwright browsers via prepare script (#1041)
1 parent 1c83fdf commit d56ff48

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/public-bobcats-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sv': patch
3+
---
4+
5+
fix(playwright): auto-install Playwright browsers via `prepare` script

packages/sv/src/addons/playwright.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default defineAddon({
1414
sv.file(
1515
file.package,
1616
transforms.json(({ data, json }) => {
17+
json.packageScriptsUpsert(data, 'prepare', 'playwright install', { mode: 'prepend' });
1718
json.packageScriptsUpsert(data, 'test:e2e', 'playwright test');
1819
json.packageScriptsUpsert(data, 'test', 'npm run test:e2e');
1920
})

packages/sv/src/cli/tests/snapshots/create-with-all-addons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "vite dev",
88
"build": "vite build",
99
"preview": "vite preview",
10-
"prepare": "svelte-kit sync || echo ''",
10+
"prepare": "playwright install && svelte-kit sync || echo ''",
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1313
"lint": "prettier --check . && eslint .",

0 commit comments

Comments
 (0)