Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 06a4d18

Browse files
committed
chore: fix single icon case
1 parent 16b8091 commit 06a4d18

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

packages/gatsby-plugin-manifest/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@redocly/gatsby-plugin-manifest",
33
"description": "Gatsby plugin which adds a manifest.webmanifest to make sites progressive web apps",
4-
"version": "3.3.0",
4+
"version": "3.3.2",
55
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
66
"bugs": {
77
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -13,14 +13,14 @@
1313
"semver": "^7.3.2"
1414
},
1515
"optionalDependencies": {
16-
"sharp": "^0.28.0"
16+
"sharp": "^0.27.2"
1717
},
1818
"devDependencies": {
1919
"@babel/cli": "^7.12.1",
2020
"@babel/core": "^7.12.3",
2121
"babel-preset-gatsby-package": "^1.3.0",
2222
"cross-env": "^7.0.3",
23-
"sharp": "^0.28.0"
23+
"sharp": "^0.27.2"
2424
},
2525
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-manifest#readme",
2626
"keywords": [

packages/gatsby-plugin-manifest/src/gatsby-node.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ function getSharp() {
1313
sharp = require(`./safe-sharp`)
1414
sharp.simd(true)
1515
}
16+
17+
// Handle Sharp's concurrency based on the Gatsby CPU count
18+
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
19+
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
20+
sharp.concurrency(cpuCoreCount())
21+
1622
return sharp
1723
}
1824

19-
// Handle Sharp's concurrency based on the Gatsby CPU count
20-
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
21-
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
22-
sharp.concurrency(cpuCoreCount())
23-
2425
async function generateIcon(icon, srcIcon) {
2526
const imgPath = path.join(`public`, icon.src)
2627

packages/gatsby-plugin-manifest/src/gatsby-ssr.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ exports.onRenderBody = (
5656
)
5757
}
5858
}
59+
} else if (icons.length) {
60+
// otherwise use first icon as favicon.
61+
headComponents.push(
62+
<link
63+
key={`gatsby-plugin-manifest-icon-link-png`}
64+
rel="icon"
65+
href={withPrefix(addDigestToPath(icons[0].src, cacheDigest, `none`))}
66+
type="image/png"
67+
/>
68+
)
5969
}
6070

6171
// Add manifest link tag.

0 commit comments

Comments
 (0)