From 8103ea89615d5106f13fb45490ea64575f5f9624 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 22 Oct 2023 10:40:17 +0200 Subject: debugging option to not embed stylesheet and js --- src/Main.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 03709d4..a59b38a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -62,12 +62,22 @@ getHomeR = do getBundleR :: Handler TypedContent getBundleR = do cacheSeconds $ 60 * 60 * 24 * 7 - return $ TypedContent typeJavascript $ toContent ($(embedFile "build/bundle.js")) + noEmbed <- confNoEmbed . config <$> getYesod + bundle <- liftIO $ bool + (pure $ toContent ($(embedFile "build/bundle.js"))) + (toContent <$> readFile "../build/bundle.js") + noEmbed + return $ TypedContent typeJavascript bundle getStyleR :: Handler TypedContent getStyleR = do cacheSeconds $ 60 * 60 * 24 * 7 - return $ TypedContent typeCss $ toContent ($(embedFile "build/style.css")) + noEmbed <- confNoEmbed . config <$> getYesod + stylesheet <- liftIO $ bool + (pure $ toContent ($(embedFile "build/style.css"))) + (toContent <$> readFile "../build/style.css") + noEmbed + return $ TypedContent typeCss stylesheet getBangsR :: Handler TypedContent getBangsR = do -- cgit v1.2.3-70-g09d2