(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.
(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:
<link rel="stylesheet"> for each CSS file in the entry's css list
<link rel="stylesheet"> for CSS files from recursively imported chunks
<script type="module"> for JS entries, or <link rel="stylesheet"> for CSS entries
<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.
(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})Malli schema for zodiac-assets options.
Malli schema for zodiac-assets options.
Schema for vite build mode options.
Schema for vite build mode options.
Schema for vite dev-server mode options.
Schema for vite dev-server mode options.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |