Skip to content

Commit 36f954b

Browse files
jineshshah36yyx990803
authored andcommitted
feat(pwa): Make injected meta tags configurable and change defaults (#961)
This change proposes 2 things: 1. Make apple-mobile-web-app-capable and apple-mobile-web-app-status-bar-style configurable 2. Change the defaults to "no" and "default", respectively
1 parent fe5923d commit 36f954b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const defaults = {
22
name: 'PWA app',
33
themeColor: '#4DBA87', // The Vue color
4-
msTileColor: '#000000'
4+
msTileColor: '#000000',
5+
appleMobileWebAppCapable: "no",
6+
appleMobileWebAppStatusBarStyle: "default",
57
}
68

79
module.exports = class HtmlPwaPlugin {
@@ -18,7 +20,7 @@ module.exports = class HtmlPwaPlugin {
1820
})
1921

2022
compilation.plugin('html-webpack-plugin-alter-asset-tags', (data, cb) => {
21-
const { name, themeColor, msTileColor } = this.options
23+
const { name, themeColor, msTileColor, appleMobileWebAppCapable, appleMobileWebAppStatusBarStyle } = this.options
2224
const { publicPath } = compiler.options.output
2325

2426
data.head.push(
@@ -49,11 +51,11 @@ module.exports = class HtmlPwaPlugin {
4951
// Add to home screen for Safari on iOS
5052
makeTag('meta', {
5153
name: 'apple-mobile-web-app-capable',
52-
content: 'yes'
54+
content: appleMobileWebAppCapable
5355
}),
5456
makeTag('meta', {
5557
name: 'apple-mobile-web-app-status-bar-style',
56-
content: 'black'
58+
content: appleMobileWebAppStatusBarStyle
5759
}),
5860
makeTag('meta', {
5961
name: 'apple-mobile-web-app-title',

0 commit comments

Comments
 (0)