Skip to content

Commit

Permalink
Merge pull request #9 from rgoshen/add-compression
Browse files Browse the repository at this point in the history
add text compresison for better performance
  • Loading branch information
rgoshen authored Nov 10, 2024
2 parents 836556a + 36d2b1d commit b74caf5
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
58 changes: 57 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"globals": "^15.11.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"vite-plugin-compression": "^0.5.1"
},
"dependencies": {
"mdb-react-ui-kit": "^9.0.0",
Expand Down
14 changes: 13 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import compression from 'vite-plugin-compression';

// https://vite.dev/config/
export default defineConfig({
root: './',
build: {
outDir: 'dist',
},
plugins: [react()],
plugins: [
react(),
compression({
algorithm: 'gzip', // You can also use 'brotliCompress' for Brotli
ext: '.gz', // Extension for compressed files
deleteOriginFile: false, // Keeps the original file for S3 uploads
}),
compression({
algorithm: 'brotliCompress',
ext: '.br',
}),
],
});

0 comments on commit b74caf5

Please sign in to comment.