Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

build: squash last vite html lint warning (importmap order false-positive)

nirholas186e5b8b8137
diff --git a/public/reputation/index.html b/public/reputation/index.html
index 02afa5385..255c63165 100644
--- a/public/reputation/index.html
+++ b/public/reputation/index.html
@@ -8,10 +8,11 @@
<meta name="description" content="View and submit on-chain reviews for AI agents registered on three.ws." />
<meta name="theme-color" content="#0a0a0a" />
- <!-- Importmap must be parsed before any <script type="module"> or
- <link rel="modulepreload">. Keep it as the FIRST child of <head>
- so Vite's auto-injected modulepreloads (added at the top of <head>
- during build) never end up before it. -->
+ <!-- Importmap must parse before any module script or modulepreload link.
+ Keep it as the first child of head so Vite's auto-injected
+ modulepreloads (added at the top of head during build) never end up
+ before it. NOTE: avoid mentioning the literal tag names inside this
+ comment — Vite's html lint regex-matches them and false-positives. -->
<script type="importmap">
{
"imports": {
diff --git a/vite.config.js b/vite.config.js
index 0248beb90..c759593aa 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -727,7 +727,15 @@ const appConfig = {
transformIndexHtml: {
order: 'pre',
handler() {
- return [{ tag: 'script', children: GUARD, injectTo: 'head-prepend' }];
+ // `injectTo: 'head'` (end of head) rather than 'head-prepend'
+ // so any importmap declared by the source page stays the first
+ // child of <head> — vite's html lint warns whenever ANY script
+ // precedes an importmap, even a sync classic script like ours.
+ // The guard is a sync <script>, so it still runs before any
+ // deferred type=module script. Closing-bundle pass below
+ // guarantees the marker exists in every dist HTML even if the
+ // transform was skipped for that entry.
+ return [{ tag: 'script', children: GUARD, injectTo: 'head' }];
},
},
closeBundle: {