Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server files being included by default - glob seems to not be functioning properly #86

Closed
petermakeswebsites opened this issue Aug 23, 2024 · 0 comments · Fixed by #87
Closed

Comments

@petermakeswebsites
Copy link

petermakeswebsites commented Aug 23, 2024

Attempting to build the service worker for some reason includes the server files, which throws an error at runtime.

It appears that the glob is defaulting to "server/.". When I tried to override by manually adding this to globIgnores, it still didn't work.

However, it did work when I changed to either server/**/* or server/**, suggesting that potentially this default glob isn't functioning properly?

"vite-plugin-pwa": "^0.20.1",
"@sveltejs/kit": "^1.30.4",
"vite": "^4.5.3",
"@vite-pwa/sveltekit": "^0.6.0",
"svelte": "^4.2.18",
            SvelteKitPWA({
                srcDir: "build",
                registerType: "prompt",
                mode: mode === "development" ? "development" : "production",
                workbox: {
                    cleanupOutdatedCaches: true,
                    inlineWorkboxRuntime: true,
                    maximumFileSizeToCacheInBytes: 1024 * 1024 * 1024,
                    globPatterns: ["**/*.{js,css,ico,png,svg,webp,woff,woff2,ttf}"],
                    // This is a little patch seems to correct the issue
                    globIgnores: ["server/**"],
                },
                strategies: "generateSW",
                includeAssets: [".well-known/assetlinks.json", "apple-app-site-association"],
                manifest: {
                    name: "name",
                    short_name: "name"
                    description: "desc",
                    theme_color: "#403053",
                    background_color: "#403053",
                    icons: [...
                    ],
                },
            })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant