judge&ui: optimize bundle size

pull/434/head
undefined 2 years ago
parent e70b1f53ed
commit 265b14236a

@ -0,0 +1,2 @@
vendor/testlib/tests
node_modules

@ -1,7 +1,7 @@
{ {
"name": "@hydrooj/hydrojudge", "name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js", "bin": "bin/hydrojudge.js",
"version": "3.0.2", "version": "3.0.3",
"main": "package.json", "main": "package.json",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",

@ -122,9 +122,9 @@ async function main() {
fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`); fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`);
} }
if (argv.options.production) { if (argv.options.production) {
fs.removeSync('public/vditor/dist/js/echarts'); for (const f of ['echarts', 'graphviz', 'mermaid', 'mathjax']) {
fs.removeSync('public/vditor/dist/js/graphviz'); fs.removeSync(`public/vditor/dist/js/${f}`);
fs.removeSync('public/vditor/dist/js/mermaid'); }
const files = fs.readdirSync('public'); const files = fs.readdirSync('public');
files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`)); files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`));
} }

@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.40.7", "version": "4.40.8",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",

Loading…
Cancel
Save