Skip to content

Commit 34b948e

Browse files
haoqunjiangcexbrayat
authored andcommitted
fix: add cypress install to prepare script to fix pnpm 10 compatibility
This approach works with both pnpm 10 and other package managers: - If Cypress's `postinstall` script has been run, it'll do nothing other than print a message. - If `postinstall` hasn't been run, it'll download the Cypress binary. As for why using `prepare` instead of `postinstall`, please refer to the discussion thread where `husky` decided to use `prepare`: - <typicode/husky#884>
1 parent 9d804ae commit 34b948e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

template/config/cypress/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"scripts": {
3+
"prepare": "cypress install",
34
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
45
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'"
56
},

0 commit comments

Comments
 (0)