diff --git a/packages/ui-next/index.html b/packages/ui-next/index.html
index 1d7f9faf7..deacd330d 100644
--- a/packages/ui-next/index.html
+++ b/packages/ui-next/index.html
@@ -5,6 +5,7 @@
Hydro
+
diff --git a/packages/ui-next/index.ts b/packages/ui-next/index.ts
index 9fc34d844..30acceb3c 100644
--- a/packages/ui-next/index.ts
+++ b/packages/ui-next/index.ts
@@ -2,11 +2,13 @@ import fs from 'fs';
import path from 'path';
import importMetaUrlPlugin from '@codingame/esbuild-import-meta-url-plugin';
import react from '@vitejs/plugin-react-swc';
-import c2k from 'koa2-connect';
+import c2k from 'koa2-connect/ts';
import { createServer } from 'vite';
import { } from '@hydrooj/framework';
import { Context } from 'hydrooj';
+const INJECT_MARKER = '';
+
export async function apply(ctx: Context) {
if (process.env.HYDRO_CLI) return;
const vite = await createServer({
@@ -49,7 +51,15 @@ export async function apply(ctx: Context) {
output: 'html',
asFallback: false,
priority: 100,
- render: async (name, args, context) => await vite.transformIndexHtml(context.handler.context.req.url, html),
+ async render(name, args, context) {
+ const htmlToRender = html.replace(INJECT_MARKER, ``);
+ return await vite.transformIndexHtml(context.handler.context.req.url!, htmlToRender);
+ },
});
// eslint-disable-next-line consistent-return
diff --git a/packages/ui-next/package.json b/packages/ui-next/package.json
index a517bbfc8..30d7d39b8 100644
--- a/packages/ui-next/package.json
+++ b/packages/ui-next/package.json
@@ -8,14 +8,14 @@
"preview": "vite preview"
},
"dependencies": {
- "@vitejs/plugin-react": "^6.0.1",
+ "koa2-connect": "^1.0.2",
"react": "^19.2.5",
"react-dom": "^19.2.5"
},
"devDependencies": {
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
- "@vitejs/plugin-react-swc": "^4.3.0",
+ "@vitejs/plugin-react": "^6.0.1",
"vite": "^8.0.10"
}
}