pwa-module icon indicating copy to clipboard operation
pwa-module copied to clipboard

runtimeCaching urlPattern and pagesURLPattern only accept strings

Open gavmck opened this issue 3 years ago • 2 comments

The urlPattern in runtimeCaching and the pageURLPattern option, both only accept strings.

The docs for pagesURLPattern suggest it accepts either a string or a RegEx, but this does not work. There are no examples for a runtimeCaching object other than under "Adding custom runtimeCaching items for CDN".

Workbox itself accepts RegEx, string or match function.

gavmck avatar Jun 29 '22 09:06 gavmck

+1 on this, it actually says in the docs regex is supported: https://pwa.nuxtjs.org/workbox/#pagesurlpattern

But setting it like this will result in an empty string being passed to workbox: pagesURLPattern: /^(?!\/auth).*$/

As I am trying to use a regex to exclude only some pages, I cannot get this to work with a string notation.

FreekVR avatar May 26 '23 12:05 FreekVR