how to add domains to next.config.js for “next/image” while using a plugin

You simply have to add the images object to the config object passed to withImages.

// next.config.js

const withImages = require("next-images");

module.exports = withImages({
    images: {
        domains: ['localhost:3001']
    },
    webpack(config, options) {
        return config;
    }
});

Leave a Comment