File tree Expand file tree Collapse file tree 4 files changed +7
-9
lines changed
gatsby-plugin-manifest/src Expand file tree Collapse file tree 4 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 11import * as fs from "fs"
22import * as path from "path"
33import sharp from "./safe-sharp"
4- import { createContentDigest , cpuCoreCount , slash } from "gatsby-core-utils"
4+ import { createContentDigest , slash } from "gatsby-core-utils"
55import { defaultIcons , addDigestToPath , favicons } from "./common"
66import { doesIconExist } from "./node-helpers"
77
88import pluginOptionsSchema from "./pluginOptionsSchema"
99
1010sharp . simd ( true )
1111
12- // Handle Sharp's concurrency based on the Gatsby CPU count
13- // See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
14- // See: https://www.gatsbyjs.org/docs/multi-core-builds/
15- sharp . concurrency ( cpuCoreCount ( ) - 1 )
12+ // force it to be 1 as we only resize one image
13+ sharp . concurrency ( 1 )
1614
1715async function generateIcon ( icon , srcIcon ) {
1816 const imgPath = path . join ( `public` , icon . src )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const q = queue(
3232 args . pluginOptions
3333 )
3434 ) ,
35- cpuCoreCount ( ) - 1
35+ Math . max ( 1 , cpuCoreCount ( ) - 1 )
3636)
3737
3838/**
Original file line number Diff line number Diff line change @@ -660,7 +660,7 @@ export const createWebpackUtils = (
660660 } ,
661661 ...terserOptions ,
662662 } ,
663- parallel : cpuCoreCount ( ) - 1 ,
663+ parallel : Math . max ( 1 , cpuCoreCount ( ) - 1 ) ,
664664 ...options ,
665665 } )
666666
@@ -731,7 +731,7 @@ export const createWebpackUtils = (
731731 }
732732 ) : CssMinimizerPlugin =>
733733 new CssMinimizerPlugin ( {
734- parallel : cpuCoreCount ( ) - 1 ,
734+ parallel : Math . max ( 1 , cpuCoreCount ( ) - 1 ) ,
735735 ...options ,
736736 } )
737737
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { cpuCoreCount } from "gatsby-core-utils"
33
44export const create = ( ) : Worker =>
55 new Worker ( require . resolve ( `./child` ) , {
6- numWorkers : cpuCoreCount ( ) - 1 ,
6+ numWorkers : Math . max ( 1 , cpuCoreCount ( ) - 1 ) ,
77 forkOptions : {
88 silent : false ,
99 } ,
You can’t perform that action at this time.
0 commit comments