File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,15 @@ export default async function build(
360360 PAGES_MANIFEST
361361 )
362362
363+ // Sharp is optional.
364+ let sharpPath : string | null = null
365+ try {
366+ sharpPath = path . relative (
367+ dir ,
368+ path . join ( path . dirname ( require . resolve ( 'sharp' ) ) , '**/*' )
369+ )
370+ } catch ( e ) { }
371+
363372 const requiredServerFiles = {
364373 version : 1 ,
365374 config : {
@@ -383,12 +392,7 @@ export default async function build(
383392 ]
384393 . filter ( nonNullable )
385394 . map ( ( file ) => path . join ( config . distDir , file ) ) ,
386- ignore : [
387- path . relative (
388- dir ,
389- path . join ( path . dirname ( require . resolve ( 'sharp' ) ) , '**/*' )
390- ) ,
391- ] ,
395+ ignore : [ sharpPath ] . filter ( nonNullable ) ,
392396 }
393397
394398 const configs = await Promise . all ( [
You can’t perform that action at this time.
0 commit comments