@@ -18,7 +18,13 @@ async function ensureCacheDir() {
1818 }
1919}
2020
21- export async function getLqip ( imagePath : { src : string } , isDevelopment : boolean , isPrerendered : boolean | undefined , lqipType : LqipType , lqipSize : number ) {
21+ export async function getLqip (
22+ imagePath : { src : string } ,
23+ lqipType : LqipType ,
24+ lqipSize : number ,
25+ isDevelopment : boolean | undefined ,
26+ isPrerendered : boolean | undefined
27+ ) {
2228 if ( ! imagePath ?. src ) return undefined
2329
2430 if ( isRemoteUrl ( imagePath . src ) ) {
@@ -33,7 +39,7 @@ export async function getLqip(imagePath: { src: string }, isDevelopment: boolean
3339 await writeFile ( tempPath , buffer )
3440
3541 try {
36- const lqip = await generateLqip ( tempPath , isDevelopment , lqipType , lqipSize )
42+ const lqip = await generateLqip ( tempPath , lqipType , lqipSize , isDevelopment )
3743 return lqip
3844 } finally {
3945 await unlink ( tempPath )
@@ -42,17 +48,17 @@ export async function getLqip(imagePath: { src: string }, isDevelopment: boolean
4248
4349 if ( isDevelopment && imagePath . src . startsWith ( '/@fs/' ) ) {
4450 const filePath = imagePath . src . replace ( / ^ \/ @ f s / , '' ) . split ( '?' ) [ 0 ]
45- return await generateLqip ( filePath , isDevelopment , lqipType , lqipSize )
51+ return await generateLqip ( filePath , lqipType , lqipSize , isDevelopment )
4652 }
4753
4854 if ( ! isPrerendered && ! isDevelopment ) {
4955 const filePath = join ( process . cwd ( ) , 'dist' , 'client' , imagePath . src )
50- return await generateLqip ( filePath , isDevelopment , lqipType , lqipSize )
56+ return await generateLqip ( filePath , lqipType , lqipSize , isDevelopment )
5157 }
5258
5359 if ( ! isDevelopment && imagePath . src . startsWith ( '/_astro/' ) ) {
5460 const buildPath = join ( process . cwd ( ) , 'dist' , imagePath . src )
55- return await generateLqip ( buildPath , isDevelopment , lqipType , lqipSize )
61+ return await generateLqip ( buildPath , lqipType , lqipSize , isDevelopment )
5662 }
5763
5864 return undefined
0 commit comments