Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions packages/gatsby-plugin-manifest/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ const { defaultIcons, doesIconExist } = require(`./common.js`)

sharp.simd(true)

// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
const cpuCoreCount = require(`gatsby/dist/utils/cpu-core-count`)
sharp.concurrency(cpuCoreCount())
try {
// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
const cpuCoreCount = require(`gatsby/dist/utils/cpu-core-count`)
sharp.concurrency(cpuCoreCount())
} catch {
// if above throws error this probably means that used Gatsby version
// doesn't support cpu-core-count utility.
}

function generateIcons(icons, srcIcon) {
return Promise.map(icons, icon => {
Expand Down
15 changes: 10 additions & 5 deletions packages/gatsby-plugin-sharp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,16 @@ Promise.promisifyAll(sharp.prototype, { multiArgs: true })
// adventurous and see what happens with it on.
sharp.simd(true)

// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
const cpuCoreCount = require(`gatsby/dist/utils/cpu-core-count`)
sharp.concurrency(cpuCoreCount())
try {
// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
const cpuCoreCount = require(`gatsby/dist/utils/cpu-core-count`)
sharp.concurrency(cpuCoreCount())
} catch {
// if above throws error this probably means that used Gatsby version
// doesn't support cpu-core-count utility.
}

const bar = new ProgressBar(
`Generating image thumbnails [:bar] :current/:total :elapsed secs :percent`,
Expand Down