File tree 2 files changed +20
-10
lines changed
gatsby-plugin-manifest/src
2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,16 @@ const { defaultIcons, doesIconExist } = require(`./common.js`)
6
6
7
7
sharp . simd ( true )
8
8
9
- // Handle Sharp's concurrency based on the Gatsby CPU count
10
- // See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
11
- // See: https://www.gatsbyjs.org/docs/multi-core-builds/
12
- const cpuCoreCount = require ( `gatsby/dist/utils/cpu-core-count` )
13
- sharp . concurrency ( cpuCoreCount ( ) )
9
+ try {
10
+ // Handle Sharp's concurrency based on the Gatsby CPU count
11
+ // See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
12
+ // See: https://www.gatsbyjs.org/docs/multi-core-builds/
13
+ const cpuCoreCount = require ( `gatsby/dist/utils/cpu-core-count` )
14
+ sharp . concurrency ( cpuCoreCount ( ) )
15
+ } catch {
16
+ // if above throws error this probably means that used Gatsby version
17
+ // doesn't support cpu-core-count utility.
18
+ }
14
19
15
20
function generateIcons ( icons , srcIcon ) {
16
21
return Promise . map ( icons , icon => {
Original file line number Diff line number Diff line change @@ -62,11 +62,16 @@ Promise.promisifyAll(sharp.prototype, { multiArgs: true })
62
62
// adventurous and see what happens with it on.
63
63
sharp . simd ( true )
64
64
65
- // Handle Sharp's concurrency based on the Gatsby CPU count
66
- // See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
67
- // See: https://www.gatsbyjs.org/docs/multi-core-builds/
68
- const cpuCoreCount = require ( `gatsby/dist/utils/cpu-core-count` )
69
- sharp . concurrency ( cpuCoreCount ( ) )
65
+ try {
66
+ // Handle Sharp's concurrency based on the Gatsby CPU count
67
+ // See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
68
+ // See: https://www.gatsbyjs.org/docs/multi-core-builds/
69
+ const cpuCoreCount = require ( `gatsby/dist/utils/cpu-core-count` )
70
+ sharp . concurrency ( cpuCoreCount ( ) )
71
+ } catch {
72
+ // if above throws error this probably means that used Gatsby version
73
+ // doesn't support cpu-core-count utility.
74
+ }
70
75
71
76
const bar = new ProgressBar (
72
77
`Generating image thumbnails [:bar] :current/:total :elapsed secs :percent` ,
You can’t perform that action at this time.
0 commit comments