File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ export function configurePWAOptions(
4141 if ( nuxt . options . dev ) {
4242 // on dev force always to use the root
4343 options . workbox . navigateFallback = options . workbox . navigateFallback ?? nuxt . options . app . baseURL ?? '/'
44- if ( options . devOptions ?. enabled && ! options . devOptions . navigateFallbackAllowlist )
45- options . devOptions . navigateFallbackAllowlist = [ nuxt . options . app . baseURL ? new RegExp ( nuxt . options . app . baseURL ) : / \/ / ]
44+ if ( options . devOptions ?. enabled && ! options . devOptions . navigateFallbackAllowlist ) {
45+ const baseURL = nuxt . options . app . baseURL
46+ // fix #214
47+ options . devOptions . navigateFallbackAllowlist = [ baseURL
48+ ? new RegExp ( `^${ baseURL . replace ( / [ - / \\ ^ $ * + ? . ( ) | [ \] { } ] / g, '\\$&' ) } $` )
49+ : / ^ \/ $ / ]
50+ }
4651 }
4752 // the user may want to disable offline support
4853 if ( ! ( 'navigateFallback' in options . workbox ) )
@@ -102,13 +107,8 @@ export function configurePWAOptions(
102107 }
103108
104109 // allow override manifestTransforms
105- if ( options . devOptions ?. enabled && ! options . devOptions . navigateFallbackAllowlist ) {
106- const baseURL = nuxt . options . app . baseURL
107- // fix #214
108- options . devOptions . navigateFallbackAllowlist = [ baseURL
109- ? new RegExp ( `^${ baseURL . replace ( / [ - / \\ ^ $ * + ? . ( ) | [ \] { } ] / g, '\\$&' ) } $` )
110- : / ^ \/ $ / ]
111- }
110+ if ( ! nuxt . options . dev && ! config . manifestTransforms )
111+ config . manifestTransforms = [ createManifestTransform ( nuxt . options . app . baseURL ?? '/' , options . outDir , appManifestFolder ) ]
112112
113113 if ( options . pwaAssets ) {
114114 options . pwaAssets . integration = {
You can’t perform that action at this time.
0 commit comments