Django Template Tag for Dashboard Vite Build Assets
Django template tags for the Dashboard app.
- smarter.apps.dashboard.templatetags.react_dashboard.dashboard_react_assets()[source]
Load CSS and JS files for a React app entry point based on its manifest.json.
- Return type:
- smarter.apps.dashboard.templatetags.react_dashboard.templatetag_manager = <smarter.lib.django.templatetags.smarter_react_templatetag_manager.SmarterReactTemplateTagManager object>
Manages integration of Vite-built React assets into Django templates. Expects to find a Vite-generated manifest.json in the file path static/react/dashboard/.
Example manifest.json structure:
{ "_rolldown-runtime.js": { "file": "assets/rolldown-runtime.js", "name": "rolldown-runtime" }, "_xterm-TdnZ7DQy.css": { "file": "assets/xterm-TdnZ7DQy.css", "src": "_xterm-TdnZ7DQy.css" }, "_xterm.js": { "file": "assets/xterm.js", "name": "xterm", "imports": [ "_rolldown-runtime.js" ], "css": [ "assets/xterm-TdnZ7DQy.css" ] }, "index.html": { "file": "assets/index.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ "_rolldown-runtime.js", "_xterm.js" ], "css": [ "assets/index-DvLY75bJ.css" ] } }