🔧 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

@ -122,7 +122,7 @@
"@types/node": "^20.3.0",
"@types/react": "^18.2.11",
"@types/react-dom": "^18.2.4",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
"babel-plugin-root-import": "^6.6.0",
@ -142,8 +142,8 @@
"ts-jest": "^29.2.5",
"typescript": "^5.3.3",
"vite": "^6.2.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-node-polyfills": "^0.17.0",
"vite-plugin-pwa": "^0.21.1"
"vite-plugin-compression2": "^1.3.3",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^0.21.2"
}
}

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) {

1745
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -91,6 +91,7 @@
"@playwright/test": "^1.50.1",
"@types/react-virtualized": "^9.22.0",
"cross-env": "^7.0.3",
"elliptic": "^6.6.1",
"eslint": "^9.20.1",
"eslint-config-prettier": "^10.0.1",
"eslint-import-resolver-typescript": "^3.7.0",
@ -110,8 +111,7 @@
"prettier": "^3.5.0",
"prettier-eslint": "^16.3.0",
"prettier-plugin-tailwindcss": "^0.6.11",
"typescript-eslint": "^8.24.0",
"elliptic": "^6.6.1"
"typescript-eslint": "^8.24.0"
},
"overrides": {
"axios": "1.8.2",