Fix service workers
This commit is contained in:
@@ -57,8 +57,9 @@ const canonicalUrl = `${siteUrl}${canonicalPath.startsWith("/") ? canonicalPath
|
||||
}
|
||||
|
||||
{
|
||||
// Register SW only in production builds (Astro sets import.meta.env.PROD at build time).
|
||||
import.meta.env.PROD ? (
|
||||
// Register SW only in production builds (Astro sets import.meta.env.PROD at build time)
|
||||
// and only when explicitly enabled by env.
|
||||
import.meta.env.PROD && import.meta.env.PUBLIC_ENABLE_SW === "true" ? (
|
||||
<script is:inline>
|
||||
{`
|
||||
if ("serviceWorker" in navigator) {
|
||||
|
||||
Reference in New Issue
Block a user