ui: builder: support css

This commit is contained in:
undefined committed 2025-01-16 01:07:37 +08:00
1 parent a63a20cd3d
commit 020b49f661
2 files changed
+12 -6

No files matched your search

+7 -1
View File
@@ -127,7 +127,13 @@ export async function buildUI() {
...entryPoints.map((i) => `import '${relative(tmp, i).replace(/\\/g, '\\\\')}';`),
].join('\n'));
const pages = entry.outputFiles.filter((i) => i.path.endsWith('.js')).map((i) => i.text);
addFile('entry.js', `window._hydroLoad=()=>{ ${pages.join('\n')} };`);
const css = entry.outputFiles.filter((i) => i.path.endsWith('.css')).map((i) => i.text);
addFile('entry.js', `window._hydroLoad=()=>{
const style = document.createElement('style');
style.textContent = ${JSON.stringify(css.join('\n'))};
document.head.appendChild(style);
${pages.join('\n')}
};`);
UiContextBase.constantVersion = hashes['entry.js'];
for (const key in vfs) {
if (newFiles.includes(key)) continue;
+5 -5
View File
@@ -14,7 +14,7 @@
"cli": false
},
"devDependencies": {
"@blueprintjs/core": "^5.16.2",
"@blueprintjs/core": "^5.16.4",
"@cordisjs/core": "3.18.1",
"@fontsource/dm-mono": "^5.1.1",
"@fontsource/fira-code": "^5.1.1",
@@ -26,7 +26,7 @@
"@fontsource/ubuntu-mono": "^5.1.1",
"@hydrooj/utils": "workspace:^",
"@sentry/browser": "^8.48.0",
"@sentry/webpack-plugin": "^2.22.7",
"@sentry/webpack-plugin": "^3.0.0",
"@simplewebauthn/browser": "9.0.1",
"@svgr/webpack": "^8.1.0",
"@types/jquery": "^3.5.32",
@@ -69,7 +69,7 @@
"jquery.easing": "^1.4.1",
"jquery.transit": "^0.9.12",
"matchmedia-polyfill": "^0.3.2",
"md-editor-rt": "^5.2.0",
"md-editor-rt": "^5.2.1",
"mini-css-extract-plugin": "^2.9.2",
"moment": "^2.30.1",
"monaco-editor": "0.50.0",
@@ -113,7 +113,7 @@
"tether-drop": "^1.4.2",
"timeago-react": "^3.0.6",
"timeago.js": "^4.0.2",
"ts-loader": "^9.5.1",
"ts-loader": "^9.5.2",
"web-streams-polyfill": "^4.1.0",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.2",
@@ -128,7 +128,7 @@
"fs-extra": "^11.2.0",
"js-yaml": "^4.1.0",
"jsesc": "^3.1.0",
"katex": "^0.16.19",
"katex": "^0.16.20",
"lodash": "^4.17.21",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",