mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: switch to async build
This commit is contained in:
1 parent
18f23b8c68
commit
7e3314774a
2 files changed
+11
-12
No files matched your search
@@ -25,8 +25,12 @@ declare module 'hydrooj/src/interface' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageFiles = Object.keys(global.Hydro.ui.manifest).filter((i) => /\.page\.[jt]sx?$/.test(i));
|
let constant = '';
|
||||||
const build = esbuild.buildSync({
|
let hash = '';
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const pageFiles = Object.keys(global.Hydro.ui.manifest).filter((i) => /\.page\.[jt]sx?$/.test(i));
|
||||||
|
const build = await esbuild.build({
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
entryPoints: pageFiles.map((i) => join(global.Hydro.ui.manifest[i], i)),
|
entryPoints: pageFiles.map((i) => join(global.Hydro.ui.manifest[i], i)),
|
||||||
bundle: true,
|
bundle: true,
|
||||||
@@ -38,15 +42,10 @@ const build = esbuild.buildSync({
|
|||||||
],
|
],
|
||||||
plugins: global.Hydro.ui.esbuildPlugins || [],
|
plugins: global.Hydro.ui.esbuildPlugins || [],
|
||||||
minify: !process.env.DEV,
|
minify: !process.env.DEV,
|
||||||
});
|
});
|
||||||
if (build.errors.length) console.error(build.errors);
|
if (build.errors.length) console.error(build.errors);
|
||||||
if (build.warnings.length) console.warn(build.warnings);
|
if (build.warnings.length) console.warn(build.warnings);
|
||||||
const pages = build.outputFiles.map((i) => i.text);
|
const pages = build.outputFiles.map((i) => i.text);
|
||||||
|
|
||||||
let constant = '';
|
|
||||||
let hash = '';
|
|
||||||
|
|
||||||
function run() {
|
|
||||||
const payload = [...pages];
|
const payload = [...pages];
|
||||||
const [logo, logo2x] = system.getMany([
|
const [logo, logo2x] = system.getMany([
|
||||||
'ui-default.nav_logo_dark', 'ui-default.nav_logo_dark_2x',
|
'ui-default.nav_logo_dark', 'ui-default.nav_logo_dark_2x',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.38.5",
|
"version": "4.38.6",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user