Skip to main content

Q&A

Can I reduce build time?

First, please check the specifications of your PC.
The standard is based on machines with 8 or more cores as recommended by SHARP, especially those with large L1/L2 CPU caches.

And if the build still takes a long time, try the following settings.

Reduce image width to be optimized

Reduce the image width generated by next/image as follows.

next.config.js
module.exports = withExportImages({
images: {
deviceSizes: [640, 960, 1280, 1600, 1920],
},
})

Reduce effort with sharp options

export-images.config.js
module.exports = {
sharpOptions: {
png: {
effort: 1,
},
webp: {
effort: 0,
},
avif: {
effort: 0,
},
},
}