From a92d5000345f61bdd6edc384f9942eea3674ba27 Mon Sep 17 00:00:00 2001 From: Megghy Date: Sat, 4 Oct 2025 10:10:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96=20vite=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=85=8D=E7=BD=AE,=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=86=97=E4=BD=99=E7=9A=84=E8=B5=84=E6=BA=90=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=92=8C=E9=A2=84=E5=8A=A0=E8=BD=BD=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.mts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/vite.config.mts b/vite.config.mts index 2b5d920..4efa9ad 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -124,13 +124,6 @@ export default defineConfig({ chunkSizeWarningLimit: 1600, // 调整警告阈值,gamepad-assets 会比较大 cssCodeSplit: true, cssMinify: 'lightningcss', - // 报告压缩后的文件大小 - reportCompressedSize: true, - // 优化模块预加载策略 - modulePreload: { - polyfill: true, - }, - // 静态资源内联阈值(小于此大小的资源会被内联为 base64) assetsInlineLimit: 4096, // 4KB,默认值,可根据需要调整 rollupOptions: { output: { @@ -236,23 +229,6 @@ export default defineConfig({ }, ], }, - chunkFileNames: 'assets/js/[name]-[hash].js', - entryFileNames: 'assets/js/[name]-[hash].js', - assetFileNames: (assetInfo: any) => { - // 根据资源类型分类存放 - const info = assetInfo.name?.split('.') ?? [] - const ext = info[info.length - 1] - if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(ext)) { - return 'assets/images/[name]-[hash][extname]' - } - if (/woff2?|ttf|otf|eot/i.test(ext)) { - return 'assets/fonts/[name]-[hash][extname]' - } - if (/css/i.test(ext)) { - return 'assets/css/[name]-[hash][extname]' - } - return 'assets/[ext]/[name]-[hash][extname]' - }, }, }, },