From 265b14236a1c9193d397f31fad926bae82e3768d Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 26 Sep 2022 01:27:40 +0800 Subject: [PATCH] judge&ui: optimize bundle size --- packages/hydrojudge/.npmignore | 2 ++ packages/hydrojudge/package.json | 2 +- packages/ui-default/build/main.ts | 6 +++--- packages/ui-default/package.json | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 packages/hydrojudge/.npmignore diff --git a/packages/hydrojudge/.npmignore b/packages/hydrojudge/.npmignore new file mode 100644 index 00000000..9d33853c --- /dev/null +++ b/packages/hydrojudge/.npmignore @@ -0,0 +1,2 @@ +vendor/testlib/tests +node_modules \ No newline at end of file diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index ebe1d22a..b9d31701 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "3.0.2", + "version": "3.0.3", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/ui-default/build/main.ts b/packages/ui-default/build/main.ts index 07da427e..e5d5abdf 100644 --- a/packages/ui-default/build/main.ts +++ b/packages/ui-default/build/main.ts @@ -122,9 +122,9 @@ async function main() { fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`); } if (argv.options.production) { - fs.removeSync('public/vditor/dist/js/echarts'); - fs.removeSync('public/vditor/dist/js/graphviz'); - fs.removeSync('public/vditor/dist/js/mermaid'); + for (const f of ['echarts', 'graphviz', 'mermaid', 'mathjax']) { + fs.removeSync(`public/vditor/dist/js/${f}`); + } const files = fs.readdirSync('public'); files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`)); } diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 030c690b..c8826261 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.40.7", + "version": "4.40.8", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js",