Skip to content

Commit

Permalink
Update buildTypes.mts
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Jan 19, 2025
1 parent 7b2d481 commit 5a862c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/buildTypes.mts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ async function addImportExtensions(folder: string) {
['@mui/internal-babel-plugin-resolve-imports'],
],
});
if (!result?.code) {
throw new Error(`Failed to transform ${dtsFile}`);

if (typeof result?.code === 'string') {
await fs.writeFile(dtsFile, result.code);
} else {
console.error('failed to transform', dtsFile);
}
await fs.writeFile(dtsFile, result.code);
}),
);
}
Expand Down

0 comments on commit 5a862c0

Please sign in to comment.