* fix: 🐛 Enabling workbox to cache webfonts and fonts-stylesheets, add local fonts for UMD build (#906)
* fix: 🐛 commonjs/umd fonts import Importing font into index-umd.js and creating a simple font css file with font-face Closes: #724 * fix: 🐛 Enabling workbox to cache webfonts and fonts-stylesheets Closes: #724 * fix: 🐛 Adding all type of fonts from google - Roboto Closes: #724
This commit is contained in:
1 parent
816666df7b
commit
69b96478cb
11 files changed
+134
-38
No files matched your search
@@ -102,6 +102,32 @@ module.exports = (env, argv) => {
|
||||
swDest: 'sw.js',
|
||||
clientsClaim: true,
|
||||
skipWaiting: true,
|
||||
exclude: [
|
||||
new RegExp('^https://fonts.googleapis.com/'),
|
||||
new RegExp('^https://fonts.gstatic.com/'),
|
||||
],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: new RegExp('^https://fonts.googleapis.com/'),
|
||||
handler: 'StaleWhileRevalidate',
|
||||
options: {
|
||||
cacheName: 'google-fonts-stylesheets',
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: new RegExp('^https://fonts.gstatic.com/'),
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'google-fonts-webfonts',
|
||||
|
||||
// Only cache 30 images / one year.
|
||||
expiration: {
|
||||
maxAgeSeconds: 60 * 60 * 24 * 365,
|
||||
maxEntries: 30,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
// https://webpack.js.org/configuration/dev-server/
|
||||
|
||||
Reference in new issue
Block a user