This library provides collections of useful hooks for shadow-cljs:
shadow-cljs-hooks.index
- generating index.html
shadow-cljs-hooks.fulcro-css
- generating CSS file for Fulcro3Add the following dependency to your deps.edn
file:
org.clojars.beetleman/shadow-cljs-hooks {:mvn/version "current version from clojars"}
Add some build hook to shadow-cljs.edn
, eg. shadow-cljs-hooks.index/hook
:
{...
:builds
{:app {:target ...
:build-hooks
[(shadow-cljs-hooks.index/hook)]
...}}}}
checkout fulcro3 example or re-frame example to seeing it in action.
shadow-cljs-hooks.index
Generate index.html
based on provided options, works with :module-hash-names true
.
:path
- (optional, default: generated from :output-dir
and :asset-path
) where index.html
should be located:lang
- (optional, default: "en"
') <html lang=...>
:title
- (optional, default: "ClojureScript 🥳🏆"
) <title>...</title>
:scripts
- (optional, default: []
) list of included .js
files:entry-point
- (optional, default: nil
) entry point for application, eg.: app/init
.
Optional because :init-fn
in modules configuration can handle it:links
- (optional, default: []
) list of included .css
files[(shadow-cljs-hooks.index/hook {:links ["https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css"]
:scripts ["https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"]})]
Used in More in re-frame example and fulcro3 example
shadow-cljs-hooks.fulcro-css
Generate CSS
files from fulcro3 project. Works with index
hook.
:output-dir
(required) the directory to use for garden output:asset-path
(required) the relative path from web server’s root to the resources
in :output-dir
:component
(required) Root
component from which CSS
will be generated:garden-flags
(optional, default {:pretty-print? false}
) garden flags[(shadow-cljs-hooks.fulcro-css/hook {:component app.main/Root
:output-dir "public/css"
:asset-path "/css"})
(shadow-cljs-hooks.index/hook)]
More in fulcro3 example
shadow-cljs-hooks.garden
Generate CSS
files from garden compatible vector. Works with index
hook as well.
:output-dir
(required) the directory to use for garden output:asset-path
(required) the relative path from web server’s root to the resources
in :output-dir
:css
(required) symbol with definition of styles:garden-flags
(optional, default {:pretty-print? false}
) garden flags[(shadow-cljs-hooks.garden/hook {:css app.css/css
:output-dir "public/css"
:asset-path "/css"})
(shadow-cljs-hooks.index/hook)]
More in re-frame example
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close