0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Next.js】Imageコンポーネントの画像最適化を無効化する方法

Posted at

個別に無効化する

特定のImageコンポーネントのみ画像最適化を無効化するにはunoptimizedpropsをtrueにします。

import Image from 'next/image'
 
const UnoptimizedImage = (props) => {
  return <Image {...props} unoptimized />
}

全て無効化する

全てのImageコンポーネントで画像最適化を無効にするにはnext.config.jsに以下のように記述します。

next.config.js
module.exports = {
  images: {
    unoptimized: true,
  },
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?