next.js/test/integration/next-image-new/middleware/middleware.js
middleware.js11 lines318 B
import Image from 'next/image'

export async function middleware(request) {
  // reference Image so it's not tree shaken / DCE
  console.log(`Has image: ${Boolean(Image)}`)

  if (request.nextUrl.pathname.startsWith('/_next/image')) {
    console.log(`x-_next-image: ${request.nextUrl.searchParams.get('url')}`)
  }
}
Quest for Codev2.0.0
/
SIGN IN