Prepend autogen for development mode (fixes #293)
This commit is contained in:
parent
c9ca0b1f9d
commit
9fea238a6d
@ -170,7 +170,13 @@ instance Yesod App where
|
|||||||
-- and names them based on a hash of their content. This allows
|
-- and names them based on a hash of their content. This allows
|
||||||
-- expiration dates to be set far in the future without worry of
|
-- expiration dates to be set far in the future without worry of
|
||||||
-- users receiving stale content.
|
-- users receiving stale content.
|
||||||
addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute [])
|
addStaticContent =
|
||||||
|
addStaticContentExternal minifym genFileName Settings.staticDir (StaticR . flip StaticRoute [])
|
||||||
|
where
|
||||||
|
-- Generate a unique filename based on the content itself
|
||||||
|
genFileName lbs
|
||||||
|
| development = "autogen-" ++ base64md5 lbs
|
||||||
|
| otherwise = base64md5 lbs
|
||||||
|
|
||||||
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
||||||
jsLoader _ = BottomOfBody
|
jsLoader _ = BottomOfBody
|
||||||
|
|||||||
@ -172,7 +172,13 @@ instance Yesod App where
|
|||||||
-- and names them based on a hash of their content. This allows
|
-- and names them based on a hash of their content. This allows
|
||||||
-- expiration dates to be set far in the future without worry of
|
-- expiration dates to be set far in the future without worry of
|
||||||
-- users receiving stale content.
|
-- users receiving stale content.
|
||||||
addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute [])
|
addStaticContent =
|
||||||
|
addStaticContentExternal minifym genFileName Settings.staticDir (StaticR . flip StaticRoute [])
|
||||||
|
where
|
||||||
|
-- Generate a unique filename based on the content itself
|
||||||
|
genFileName lbs
|
||||||
|
| development = "autogen-" ++ base64md5 lbs
|
||||||
|
| otherwise = base64md5 lbs
|
||||||
|
|
||||||
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
||||||
jsLoader _ = BottomOfBody
|
jsLoader _ = BottomOfBody
|
||||||
|
|||||||
@ -172,7 +172,13 @@ instance Yesod App where
|
|||||||
-- and names them based on a hash of their content. This allows
|
-- and names them based on a hash of their content. This allows
|
||||||
-- expiration dates to be set far in the future without worry of
|
-- expiration dates to be set far in the future without worry of
|
||||||
-- users receiving stale content.
|
-- users receiving stale content.
|
||||||
addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute [])
|
addStaticContent =
|
||||||
|
addStaticContentExternal minifym genFileName Settings.staticDir (StaticR . flip StaticRoute [])
|
||||||
|
where
|
||||||
|
-- Generate a unique filename based on the content itself
|
||||||
|
genFileName lbs
|
||||||
|
| development = "autogen-" ++ base64md5 lbs
|
||||||
|
| otherwise = base64md5 lbs
|
||||||
|
|
||||||
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
||||||
jsLoader _ = BottomOfBody
|
jsLoader _ = BottomOfBody
|
||||||
|
|||||||
@ -152,7 +152,13 @@ instance Yesod App where
|
|||||||
-- and names them based on a hash of their content. This allows
|
-- and names them based on a hash of their content. This allows
|
||||||
-- expiration dates to be set far in the future without worry of
|
-- expiration dates to be set far in the future without worry of
|
||||||
-- users receiving stale content.
|
-- users receiving stale content.
|
||||||
addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute [])
|
addStaticContent =
|
||||||
|
addStaticContentExternal minifym genFileName Settings.staticDir (StaticR . flip StaticRoute [])
|
||||||
|
where
|
||||||
|
-- Generate a unique filename based on the content itself
|
||||||
|
genFileName lbs
|
||||||
|
| development = "autogen-" ++ base64md5 lbs
|
||||||
|
| otherwise = base64md5 lbs
|
||||||
|
|
||||||
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
||||||
jsLoader _ = BottomOfBody
|
jsLoader _ = BottomOfBody
|
||||||
|
|||||||
@ -172,7 +172,13 @@ instance Yesod App where
|
|||||||
-- and names them based on a hash of their content. This allows
|
-- and names them based on a hash of their content. This allows
|
||||||
-- expiration dates to be set far in the future without worry of
|
-- expiration dates to be set far in the future without worry of
|
||||||
-- users receiving stale content.
|
-- users receiving stale content.
|
||||||
addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute [])
|
addStaticContent =
|
||||||
|
addStaticContentExternal minifym genFileName Settings.staticDir (StaticR . flip StaticRoute [])
|
||||||
|
where
|
||||||
|
-- Generate a unique filename based on the content itself
|
||||||
|
genFileName lbs
|
||||||
|
| development = "autogen-" ++ base64md5 lbs
|
||||||
|
| otherwise = base64md5 lbs
|
||||||
|
|
||||||
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
-- Place Javascript at bottom of the body tag so the rest of the page loads first
|
||||||
jsLoader _ = BottomOfBody
|
jsLoader _ = BottomOfBody
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user