From 36f954bfc9f88b3d340fcfbf20f85eb8107ddb41 Mon Sep 17 00:00:00 2001 From: Jinesh Shah Date: Wed, 25 Apr 2018 15:25:20 -0400 Subject: [PATCH] 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 --- packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js b/packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js index c2e3a9f40..c24fdca4e 100644 --- a/packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js +++ b/packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js @@ -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',