diff --git a/scripts/build.mjs b/scripts/build.mjs
index b0085790..bd847e76 100644
--- a/scripts/build.mjs
+++ b/scripts/build.mjs
@@ -44,7 +44,7 @@ async function buildHtml() {
``);
removeOrEnableScript(doc("script#phone-debug-pre"), debug);
removeOrEnableScript(doc("script#phone-debug-post"), debug);
- removeOrEnableScript(doc("script#service-worker"), false);
+ removeOrEnableScript(doc("script#service-worker"), offline);
if (offline) {
doc("html").attr("manifest", "manifest.appcache");
doc("head").append(``);