diff --git a/napcat.webui/package.json b/napcat.webui/package.json index 3651cf16..34033270 100644 --- a/napcat.webui/package.json +++ b/napcat.webui/package.json @@ -12,6 +12,7 @@ "dependencies": { "eslint-plugin-prettier": "^5.2.1", "qrcode": "^1.5.4", + "tdesign-icons-vue-next": "^0.3.3", "tdesign-vue-next": "^1.10.3", "vue": "^3.5.12", "vue-router": "^4.4.5" @@ -20,10 +21,12 @@ "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.14.0", "@types/qrcode": "^1.5.5", + "@vitejs/plugin-legacy": "^5.4.3", "@vitejs/plugin-vue": "^5.1.4", "eslint-config-prettier": "^9.1.0", "eslint-plugin-vue": "^9.31.0", "globals": "^15.12.0", + "terser": "^5.36.0", "typescript": "~5.6.2", "vite": "^5.4.10", "vue-tsc": "^2.1.8" diff --git a/napcat.webui/vite.config.ts b/napcat.webui/vite.config.ts index 5517677e..1e465bf9 100644 --- a/napcat.webui/vite.config.ts +++ b/napcat.webui/vite.config.ts @@ -1,10 +1,17 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; +import legacy from '@vitejs/plugin-legacy'; import path from 'path'; // https://vite.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [ + vue(), + legacy({ + targets: ['defaults', 'not IE 11'], + modernPolyfills: ['web.structured-clone'], + }), + ], base: './', resolve: { alias: { @@ -17,14 +24,18 @@ export default defineConfig({ }, }, build: { + chunkSizeWarningLimit: 4000, rollupOptions: { output: { - manualChunks(id) { + chunkFileNames: 'static/js/[name]-[hash].js', + entryFileNames: 'static/js/[name]-[hash].js', + assetFileNames: 'static/[ext]/[name]-[hash].[ext]', + manualChunks(id: string) { if (id.includes('node_modules')) { - return id.toString().split('node_modules/')[1].split('/')[0].toString(); + return id.toString().split('node_modules/.pnpm/')[1].split('/')[0].toString(); } - } - } - } - } -}); \ No newline at end of file + }, + }, + }, + }, +});