This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/src/Settings/StaticFiles.hs
Gregor Kleen 5d8c2af51d feat(frontend): use webpack more extensively
Also include all fonts via npm

BREAKING CHANGE: Major frontend refactor
2019-12-11 15:11:44 +01:00

30 lines
983 B
Haskell

module Settings.StaticFiles
( module Settings.StaticFiles
, module Yesod.EmbeddedStatic
) where
import ClassyPrelude
import Settings (appStaticDir, appWebpackEntrypoints, compileTimeAppSettings)
import Settings.StaticFiles.Generator
import Settings.StaticFiles.Webpack
import Yesod.EmbeddedStatic
-- This generates easy references to files in the static directory at compile time,
-- giving you compile-time verification that referenced files exist.
-- Warning: any files added to your static directory during run-time can't be
-- accessed this way.
--
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
--
-- js_script_js
#ifdef DEVELOPMENT
#define DEV_BOOL True
#else
#define DEV_BOOL False
#endif
mkEmbeddedStatic DEV_BOOL "embeddedStatic" . pure . staticGenerator $ appStaticDir compileTimeAppSettings
mkWebpackEntrypoints (appWebpackEntrypoints compileTimeAppSettings) (pure staticGenerator) $ appStaticDir compileTimeAppSettings