From db70431e0cfdc508111028d684236244f7f68ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saymon=20Dam=C3=A1sio?= Date: Wed, 9 Oct 2024 16:07:55 -0300 Subject: [PATCH] fix: does not break if called in the browser --- hooks/useScript.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/useScript.ts b/hooks/useScript.ts index b1ef02eaf..39dec4f21 100644 --- a/hooks/useScript.ts +++ b/hooks/useScript.ts @@ -6,10 +6,11 @@ * Use at your own risk. */ +import { IS_BROWSER } from "$fresh/runtime.ts"; import { LRUCache } from "npm:lru-cache@10.2.0"; import { minify as terserMinify } from "npm:terser@5.34.0"; -const verbose = !!Deno.env.get("SCRIPT_MINIFICATION_DEBUG"); +const verbose = !IS_BROWSER && !!Deno.env.get("SCRIPT_MINIFICATION_DEBUG"); const cache = new LRUCache>({ max: 100,