@@ -81,22 +81,26 @@ module.exports = class HtmlPwaPlugin {
81
81
82
82
const assetsVersionStr = assetsVersion ? `?v=${ assetsVersion } ` : ''
83
83
84
- data . head . push (
85
- // Favicons
86
- makeTag ( 'link' , {
84
+ // Favicons
85
+ if ( iconPaths . favicon32 != null ) {
86
+ data . head . push ( makeTag ( 'link' , {
87
87
rel : 'icon' ,
88
88
type : 'image/png' ,
89
89
sizes : '32x32' ,
90
90
href : getTagHref ( publicPath , iconPaths . favicon32 , assetsVersionStr )
91
- } ) ,
92
- makeTag ( 'link' , {
91
+ } ) )
92
+ }
93
+ if ( iconPaths . favicon16 != null ) {
94
+ data . head . push ( makeTag ( 'link' , {
93
95
rel : 'icon' ,
94
96
type : 'image/png' ,
95
97
sizes : '16x16' ,
96
98
href : getTagHref ( publicPath , iconPaths . favicon16 , assetsVersionStr )
97
- } ) ,
99
+ } ) )
100
+ }
98
101
99
- // Add to home screen for Android and modern mobile browsers
102
+ // Add to home screen for Android and modern mobile browsers
103
+ data . head . push (
100
104
makeTag ( 'link' , manifestCrossorigin
101
105
? {
102
106
rel : 'manifest' ,
@@ -111,9 +115,11 @@ module.exports = class HtmlPwaPlugin {
111
115
makeTag ( 'meta' , {
112
116
name : 'theme-color' ,
113
117
content : themeColor
114
- } ) ,
118
+ } )
119
+ )
115
120
116
- // Add to home screen for Safari on iOS
121
+ // Add to home screen for Safari on iOS
122
+ data . head . push (
117
123
makeTag ( 'meta' , {
118
124
name : 'apple-mobile-web-app-capable' ,
119
125
content : appleMobileWebAppCapable
@@ -125,22 +131,30 @@ module.exports = class HtmlPwaPlugin {
125
131
makeTag ( 'meta' , {
126
132
name : 'apple-mobile-web-app-title' ,
127
133
content : name
128
- } ) ,
129
- makeTag ( 'link' , {
134
+ } )
135
+ )
136
+ if ( iconPaths . appleTouchIcon != null ) {
137
+ data . head . push ( makeTag ( 'link' , {
130
138
rel : 'apple-touch-icon' ,
131
139
href : getTagHref ( publicPath , iconPaths . appleTouchIcon , assetsVersionStr )
132
- } ) ,
133
- makeTag ( 'link' , {
140
+ } ) )
141
+ }
142
+ if ( iconPaths . maskIcon != null ) {
143
+ data . head . push ( makeTag ( 'link' , {
134
144
rel : 'mask-icon' ,
135
145
href : getTagHref ( publicPath , iconPaths . maskIcon , assetsVersionStr ) ,
136
146
color : themeColor
137
- } ) ,
147
+ } ) )
148
+ }
138
149
139
- // Add to home screen for Windows
140
- makeTag ( 'meta' , {
150
+ // Add to home screen for Windows
151
+ if ( iconPaths . msTileImage != null ) {
152
+ data . head . push ( makeTag ( 'meta' , {
141
153
name : 'msapplication-TileImage' ,
142
154
content : getTagHref ( publicPath , iconPaths . msTileImage , assetsVersionStr )
143
- } ) ,
155
+ } ) )
156
+ }
157
+ data . head . push (
144
158
makeTag ( 'meta' , {
145
159
name : 'msapplication-TileColor' ,
146
160
content : msTileColor
0 commit comments