🔧 chore: Vite Plugin Upgrades & Config Optimizations (#6547)

* 🔧 fix: Update compression plugin to version 2 and adjust configuration

* 🔧 fix: Adjust compression plugin configuration to set threshold to 10240

* 🔧 fix: Update vite-plugin-node-polyfills to version 0.23.0 and add external polyfills in configuration

* 🔧 fix: Downgrade vite-plugin-node-polyfills to version 0.17.0 and remove external polyfills from configuration

* 🔧 fix: Update vite-plugin-node-polyfills to version 0.23.0 and remove outdated version from package.json

* 🔧 fix: Update vite-plugin-node-polyfills to version 0.23.0 and remove outdated version from package.json

* chore: fix vite-plugin-node-polyfills workspace installation

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
Ruben Talstra 2025-03-26 17:16:45 +01:00 committed by GitHub
parent 64f4e376a8
commit 8716d44d28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 499 additions and 1268 deletions

View file

@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import compression from 'vite-plugin-compression';
import { compression } from 'vite-plugin-compression2';
import type { Plugin } from 'vite';
// https://vitejs.dev/config/
@ -82,11 +82,7 @@ export default defineConfig({
}),
sourcemapExclude({ excludeNodeModules: true }),
compression({
verbose: true,
disable: false,
threshold: 10240, // compress files larger than 10KB
algorithm: 'gzip',
ext: '.gz',
threshold: 10240,
}),
],
publicDir: './public',
@ -144,7 +140,7 @@ export default defineConfig({
},
},
/**
* Ignore "use client" waning since we are not using SSR
* Ignore "use client" warning since we are not using SSR
* @see {@link https://github.com/TanStack/query/pull/5161#issuecomment-1477389761 Preserve 'use client' directives TanStack/query#5161}
*/
onwarn(warning, warn) {