Skip to content

Commit

Permalink
Fix next-image-new/asset-prefix for Turbopack (#61224)
Browse files Browse the repository at this point in the history
## What?

Fixes the condition being checked to match for Turbopack which always
adds the blur.

Webpack needed to lazy eval blur during `next dev` but Turbopack can
always blur since its much faster.

Closes NEXT-2259
  • Loading branch information
timneutkens committed Jan 26, 2024
1 parent 7f4ca97 commit 9626f31
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/integration/next-image-new/asset-prefix/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ describe('Image Component assetPrefix Tests', () => {
const bgImage = await browser.eval(
`document.getElementById('${id}').style['background-image']`
)
expect(bgImage).toMatch(
/\/_next\/image\?url=https%3A%2F%2Fexample\.vercel\.sh%2Fpre%2F_next%2Fstatic%2Fmedia%2Ftest(.+).jpg&w=8&q=70/
)
if (process.env.TURBOPACK) {
expect(bgImage).toContain('data:image/svg+xml;')
} else {
expect(bgImage).toMatch(
/\/_next\/image\?url=https%3A%2F%2Fexample\.vercel\.sh%2Fpre%2F_next%2Fstatic%2Fmedia%2Ftest(.+).jpg&w=8&q=70/
)
}
})

it('should not log a deprecation warning about using `images.domains`', async () => {
Expand Down

0 comments on commit 9626f31

Please sign in to comment.