From 4065ce606ad7dc4b65d4fa1915d2afb928cfd6a4 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 28 Jul 2024 23:12:48 +0800 Subject: [PATCH] :zap: Perf: disable PWA in the built-in development server --- layouts/partials/assets.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 8e806c33..14d7f945 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -230,7 +230,7 @@ {{- end -}} {{- /* PWA */ -}} -{{- if .Site.Params.enablePWA | and hugo.IsProduction -}} +{{- if not hugo.IsServer | and .Site.Params.enablePWA | and hugo.IsProduction -}} {{- $options := dict "targetPath" "service-worker.min.js" "minify" true -}} {{- $source := resources.Get "js/service-worker.js" | js.Build $options -}} {{- $_ := $source.RelPermalink -}}