const withPlugins = require("next-compose-plugins"); const optimizedImages = require("next-optimized-images"); const nextConfiguration = { target: "serverless", //will output independent pages that don't require a monolithic server. It's only compatible with next start or Serverless deployment platforms (like ZEIT Now) — you cannot use the custom server API. future: { webpack5: true, }, webpack: function (config, { dev }) { if (dev) { config.devtool = "cheap-module-source-map"; } // config.resolve.modules.push(path.resolve("./")); return config; }, }; module.exports = withPlugins([optimizedImages], nextConfiguration); // module.exports = { // future: { // webpack5: true, // }, // webpack: function (config, options) { // // console.log(options.webpack.version); // 5.18.0 // // config.experiments = {}; // return config; // }, // ...withPlugins([optimizedImages], nextConfiguration) // };