fix(vercel): Don't output an error message for failing to resolve sharp (#8354)

* fix(vercel): Don't output an error message for failing to resolve sharp

* chore: changeset
This commit is contained in:
Erika 2023-09-01 16:14:15 +02:00 committed by GitHub
parent cc99b2814f
commit 0eb09dbab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---
Fix unnecessary warning about Sharp showing while building

View file

@ -49,6 +49,9 @@ export async function copyDependenciesToFunction(
// The import(astroRemark) sometimes fails to resolve, but it's not a problem
if (module === '@astrojs/') continue;
// Sharp is always external and won't be able to be resolved, but that's also not a problem
if (module === 'sharp') continue;
if (entryPath === file) {
console.warn(
`[@astrojs/vercel] The module "${module}" couldn't be resolved. This may not be a problem, but it's worth checking.`