Skip to content

Commit

Permalink
Fix optimizeImages config when nextComposePlugins is not defined (cyr…
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelmmiguel committed Feb 22, 2020
1 parent 756bb95 commit bf9c70b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const withOptimizedImages = (nextConfig = {}, nextComposePlugins = {}) => {
|| (nextComposePlugins.phase === 'phase-export' && optimizeImages)
|| (nextComposePlugins.phase === 'phase-development-server' && optimizeImagesInDev)
)
: (!dev || optimizeImagesInDev);
: ((!dev && optimizeImages) || (dev && optimizeImagesInDev));

// show a warning if images should get optimized but no loader is installed
if (optimizeImages && getNumOptimizationLoadersInstalled(detectedLoaders) === 0 && isServer) {
Expand Down

0 comments on commit bf9c70b

Please sign in to comment.