From 4c4be66897025aa3c552d63cce92314d3b509f87 Mon Sep 17 00:00:00 2001 From: "Sakamoto, Kazunori" Date: Mon, 19 Feb 2024 14:08:27 +0900 Subject: [PATCH] fix(wb): support husky v9 --- packages/wb/src/commands/optimizeForDockerBuild.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/wb/src/commands/optimizeForDockerBuild.ts b/packages/wb/src/commands/optimizeForDockerBuild.ts index 9f377f71..5ec2a3e6 100644 --- a/packages/wb/src/commands/optimizeForDockerBuild.ts +++ b/packages/wb/src/commands/optimizeForDockerBuild.ts @@ -103,7 +103,8 @@ function optimizeScripts(packageJson: PackageJson): void { for (const [name, content] of Object.entries(scripts)) { if ( nameWordsOfUnnecessaryScripts.some((word) => name.includes(word)) || - contentWordsOfUnnecessaryScripts.some((word) => content.includes(word)) + // Support "husky" since husky v9 requires `"postinstall": "husky"` + contentWordsOfUnnecessaryScripts.some((word) => content.includes(word) || content.trim() === word.trim()) ) { delete scripts[name]; }