File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -66,21 +66,23 @@ Modify the `prepare` script to never fail:
66
66
"prepare": "husky || true"
67
67
` ` `
68
68
69
- You'll still get a `command not found` error message in your output which may be confusing. To make it silent, create `.husky/install.js ` :
69
+ You'll still get a `command not found` error message in your output which may be confusing. To make it silent, create `.husky/install.mjs ` :
70
70
71
71
` ` ` js
72
72
// Skip Husky install in production and CI
73
+ import husky from 'husky'
74
+
73
75
if (process.env.NODE_ENV === 'production' || process.env.CI === '1') {
74
76
process.exit(0)
75
77
}
76
- const husky = await import('husky')
77
- husky()
78
+
79
+ console.log( husky() )
78
80
` ` `
79
81
80
82
Then, use it in `prepare` :
81
83
82
84
` ` ` json
83
- "prepare": "node .husky/install.js "
85
+ "prepare": "node .husky/install.mjs "
84
86
` ` `
85
87
86
88
# # Testing Hooks Without Committing
You can’t perform that action at this time.
0 commit comments