Skip to content

Commit 34b58c0

Browse files
fix: allow turning off theme color tags (#5820)
Co-authored-by: Haoqun Jiang <[email protected]>
1 parent d88d927 commit 34b58c0

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Diff for: packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js

+18-11
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,18 @@ module.exports = class HtmlPwaPlugin {
111111
rel: 'manifest',
112112
href: getTagHref(publicPath, manifestPath, assetsVersionStr)
113113
}
114-
),
115-
makeTag('meta', {
116-
name: 'theme-color',
117-
content: themeColor
118-
})
114+
)
119115
)
120116

117+
if (themeColor != null) {
118+
data.head.push(
119+
makeTag('meta', {
120+
name: 'theme-color',
121+
content: themeColor
122+
})
123+
)
124+
}
125+
121126
// Add to home screen for Safari on iOS
122127
data.head.push(
123128
makeTag('meta', {
@@ -154,12 +159,14 @@ module.exports = class HtmlPwaPlugin {
154159
content: getTagHref(publicPath, iconPaths.msTileImage, assetsVersionStr)
155160
}))
156161
}
157-
data.head.push(
158-
makeTag('meta', {
159-
name: 'msapplication-TileColor',
160-
content: msTileColor
161-
})
162-
)
162+
if (msTileColor != null) {
163+
data.head.push(
164+
makeTag('meta', {
165+
name: 'msapplication-TileColor',
166+
content: msTileColor
167+
})
168+
)
169+
}
163170

164171
cb(null, data)
165172
})

0 commit comments

Comments
 (0)