Liking cljdoc? Tell your friends :D

zodiac.ext.assets


entry-htmlclj

(entry-html assets-fn entry-name)

Like entry-tags, but returns an HTML string instead of hiccup. Returns nil if entry-name is not found in the manifest.

Like entry-tags, but returns an HTML string instead of hiccup.
Returns nil if entry-name is not found in the manifest.
sourceraw docstring

entry-tagsclj

(entry-tags assets-fn entry-name)

Given an assets fn (from ::assets init-key) and an entry name, returns a list of hiccup elements following Vite's recommended tag order:

  1. <link rel="stylesheet"> for each CSS file in the entry's css list

  2. <link rel="stylesheet"> for CSS files from recursively imported chunks

  3. <script type="module"> for JS entries, or <link rel="stylesheet"> for CSS entries

  4. <link rel="modulepreload"> for each imported JS chunk (recursive)

Returns nil if entry-name is not found in the manifest.

In dev-server mode, emits a <script type="module"> tag pointing to the Vite dev server (which handles CSS injection and HMR). For a .css entry it additionally emits a <link rel="stylesheet"> to avoid FOUC — see the inline comment below.

Given an assets fn (from ::assets init-key) and an entry name, returns a list
of hiccup elements following Vite's recommended tag order:

1. <link rel="stylesheet"> for each CSS file in the entry's css list
2. <link rel="stylesheet"> for CSS files from recursively imported chunks
3. <script type="module"> for JS entries, or <link rel="stylesheet"> for CSS entries
4. <link rel="modulepreload"> for each imported JS chunk (recursive)

Returns nil if entry-name is not found in the manifest.

In dev-server mode, emits a <script type="module"> tag pointing to the
Vite dev server (which handles CSS injection and HMR). For a .css entry it
additionally emits a <link rel="stylesheet"> to avoid FOUC — see the
inline comment below.
sourceraw docstring

initclj

(init {:keys [asset-resource-path asset-url-path context-key vite]
       :or {asset-resource-path ""
            asset-url-path "/assets"
            context-key :zodiac.ext.assets/assets
            vite {:mode :build}}
       :as options})
source

Optionsclj

Malli schema for zodiac-assets options.

Malli schema for zodiac-assets options.
sourceraw docstring

ViteBuildclj

Schema for vite build mode options.

Schema for vite build mode options.
sourceraw docstring

ViteDevServerclj

Schema for vite dev-server mode options.

Schema for vite dev-server mode options.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close