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
This commit is contained in:
Jinesh Shah
2018-04-25 15:25:20 -04:00
committed by Evan You
parent fe5923d8fd
commit 36f954bfc9

View File

@@ -1,7 +1,9 @@
const defaults = {
name: 'PWA app',
themeColor: '#4DBA87', // The Vue color
msTileColor: '#000000'
msTileColor: '#000000',
appleMobileWebAppCapable: "no",
appleMobileWebAppStatusBarStyle: "default",
}
module.exports = class HtmlPwaPlugin {
@@ -18,7 +20,7 @@ module.exports = class HtmlPwaPlugin {
})
compilation.plugin('html-webpack-plugin-alter-asset-tags', (data, cb) => {
const { name, themeColor, msTileColor } = this.options
const { name, themeColor, msTileColor, appleMobileWebAppCapable, appleMobileWebAppStatusBarStyle } = this.options
const { publicPath } = compiler.options.output
data.head.push(
@@ -49,11 +51,11 @@ module.exports = class HtmlPwaPlugin {
// Add to home screen for Safari on iOS
makeTag('meta', {
name: 'apple-mobile-web-app-capable',
content: 'yes'
content: appleMobileWebAppCapable
}),
makeTag('meta', {
name: 'apple-mobile-web-app-status-bar-style',
content: 'black'
content: appleMobileWebAppStatusBarStyle
}),
makeTag('meta', {
name: 'apple-mobile-web-app-title',