Skip to content

Commit 494eed5

Browse files
authored
fix(meta): prevent build failure for ios splash image when no icon is used (#362)
* fix(meta): check ios launch scren for undefined before accessing proprieties * feat(icon): display warning on console if the icon file was not found
1 parent 304a356 commit 494eed5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/icon/module.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ async function run (pwa, _emitAssets) {
6363

6464
// Disable module if no icon specified
6565
if (!options.source) {
66+
// eslint-disable-next-line no-console
67+
console.warn('[pwa] [icon] Icon not found in ' + path.resolve(this.options.srcDir, this.options.dir.static, options.fileName))
6668
return
6769
}
6870

lib/meta/module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function generateMeta (pwa) {
9393
}
9494

9595
// Launch Screen Image (IOS)
96-
if (options.mobileAppIOS && !find(this.options.head.link, 'rel', 'apple-touch-startup-image')) {
96+
if (options.mobileAppIOS && pwa._iosSplash && !find(this.options.head.link, 'rel', 'apple-touch-startup-image')) {
9797
this.options.head.link.push({ href: pwa._iosSplash.iphonese, media: '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' })
9898
this.options.head.link.push({ href: pwa._iosSplash.iphone6, media: '(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' })
9999
this.options.head.link.push({ href: pwa._iosSplash.iphoneplus, media: '(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' })

0 commit comments

Comments
 (0)