From 4ce8f8ae85db419e5b4dfbd1a609d4e34e7e612e Mon Sep 17 00:00:00 2001 From: Devansh Jethmalani Date: Thu, 23 Sep 2021 09:35:30 +0530 Subject: [PATCH] Add instruction to add `disableStaticImages: true` --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 47af795..7b3a94d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,21 @@ module.exports = withOptimizedImages({ }); ``` +Also you probably will have to [disable Next's static imports](https://nextjs.org/docs/basic-features/image-optimization#disable-static-imports) to make the plugin work, in that case the config file would look like this + +```javascript +// next.config.js +const withOptimizedImages = require('next-optimized-images'); +module.exports = withOptimizedImages({ + /* config for next-optimized-images */ + + images: { + disableStaticImages: true + } + // your other config for other plugins or the general next.js here... +}); +``` + ## Optimization Packages Starting from version 2, you have to install the optimization packages you need in your project in addition to this plugin. `next-optimized-images` then detects all the supported packages and uses them.