From 70318e9422082cfdf6011c4c865d7c098cd9820d Mon Sep 17 00:00:00 2001 From: davidgaroro Date: Tue, 14 Aug 2018 15:31:19 +0200 Subject: [PATCH] Add pwa workbox options to cache google fonts --- vue.config.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 vue.config.js diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..21e4efa --- /dev/null +++ b/vue.config.js @@ -0,0 +1,22 @@ +const manifestJSON = require('./public/manifest.json') + +module.exports = { + pwa: { + themeColor: manifestJSON.theme_color, + workboxOptions: { + runtimeCaching: [{ + urlPattern: new RegExp('https://fonts.(?:googleapis|gstatic).com/(.*)'), + handler: 'cacheFirst', + options: { + cacheName: 'google-fonts', + expiration: { + maxEntries: 30 + }, + cacheableResponse: { + statuses: [0, 200] + } + } + }] + } + } +}