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
+19
-20
No files matched your search
@@ -25,28 +25,27 @@ declare module 'hydrooj/src/interface' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageFiles = Object.keys(global.Hydro.ui.manifest).filter((i) => /\.page\.[jt]sx?$/.test(i));
|
|
||||||
const build = esbuild.buildSync({
|
|
||||||
format: 'iife',
|
|
||||||
entryPoints: pageFiles.map((i) => join(global.Hydro.ui.manifest[i], i)),
|
|
||||||
bundle: true,
|
|
||||||
outdir: tmpdir(),
|
|
||||||
splitting: false,
|
|
||||||
write: false,
|
|
||||||
target: [
|
|
||||||
'chrome60',
|
|
||||||
],
|
|
||||||
plugins: global.Hydro.ui.esbuildPlugins || [],
|
|
||||||
minify: !process.env.DEV,
|
|
||||||
});
|
|
||||||
if (build.errors.length) console.error(build.errors);
|
|
||||||
if (build.warnings.length) console.warn(build.warnings);
|
|
||||||
const pages = build.outputFiles.map((i) => i.text);
|
|
||||||
|
|
||||||
let constant = '';
|
let constant = '';
|
||||||
let hash = '';
|
let hash = '';
|
||||||
|
|
||||||
function run() {
|
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',
|
||||||
|
entryPoints: pageFiles.map((i) => join(global.Hydro.ui.manifest[i], i)),
|
||||||
|
bundle: true,
|
||||||
|
outdir: tmpdir(),
|
||||||
|
splitting: false,
|
||||||
|
write: false,
|
||||||
|
target: [
|
||||||
|
'chrome60',
|
||||||
|
],
|
||||||
|
plugins: global.Hydro.ui.esbuildPlugins || [],
|
||||||
|
minify: !process.env.DEV,
|
||||||
|
});
|
||||||
|
if (build.errors.length) console.error(build.errors);
|
||||||
|
if (build.warnings.length) console.warn(build.warnings);
|
||||||
|
const pages = build.outputFiles.map((i) => i.text);
|
||||||
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