Skip to content

Commit

Permalink
fix(manifest): fixed the manifest containing include_favicon and brea…
Browse files Browse the repository at this point in the history
…king on multiple icon paths
  • Loading branch information
me4502 committed Apr 3, 2019
1 parent 97ea077 commit c7ea1d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/gatsby-plugin-manifest/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ exports.onPostBootstrap = async ({ reporter }, pluginOptions) => {
delete manifest.cache_busting_mode
delete manifest.crossOrigin
delete manifest.icon_options
delete manifest.include_favicon

// If icons are not manually defined, use the default icon set.
if (!manifest.icons) {
Expand All @@ -70,11 +71,13 @@ exports.onPostBootstrap = async ({ reporter }, pluginOptions) => {
}

// Determine destination path for icons.
const iconPath = path.join(`public`, path.dirname(manifest.icons[0].src))
for (let i = 0; i < manifest.icons.length; i++) {
const iconPath = path.join(`public`, path.dirname(manifest.icons[i].src))

//create destination directory if it doesn't exist
if (!fs.existsSync(iconPath)) {
fs.mkdirSync(iconPath)
//create destination directory if it doesn't exist
if (!fs.existsSync(iconPath)) {
fs.mkdirSync(iconPath)
}
}

// Only auto-generate icons if a src icon is defined.
Expand Down

0 comments on commit c7ea1d4

Please sign in to comment.