Skip to content

Commit d70d4ef

Browse files
committed
change variable name, add error message
1 parent c0cf355 commit d70d4ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/prepack.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@ try {
9191
async function runPackagePrepack(packagePrepackPath: string): Promise<void> {
9292
const { prepack } = await import(packagePrepackPath);
9393
if (prepack && typeof prepack === 'function') {
94-
const success = prepack(buildDir);
95-
if (!success) {
94+
const isScuccess = prepack(buildDir);
95+
if (!isScuccess) {
9696
process.exit(1);
9797
}
98+
} else {
99+
console.error(`Could not find a prepack function in ${packagePrepackPath}.`);
100+
console.error(
101+
'Make sure, your package-specific prepack script exports `function prepack(buildDir: string): boolean`.',
102+
);
103+
process.exit(1);
98104
}
99105
}
100106

0 commit comments

Comments
 (0)