chore: split vendor bundle (#740)

This commit is contained in:
Carlos Valente
2024-01-27 22:30:23 +01:00
committed by GitHub
parent 86cec56a3d
commit 32d70b3cd5
+8
View File
@@ -2,6 +2,7 @@ import { sentryVitePlugin } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react';
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import { splitVendorChunkPlugin } from 'vite';
import { compression } from 'vite-plugin-compression2';
import svgrPlugin from 'vite-plugin-svgr';
@@ -13,6 +14,7 @@ const isDev = process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'deve
export default defineConfig({
plugins: [
react(),
splitVendorChunkPlugin(),
svgrPlugin(),
!isDev &&
sentryVitePlugin({
@@ -24,6 +26,12 @@ export default defineConfig({
deploy: {
env: 'production',
},
bundleSizeOptimizations: {
excludeDebugStatements: true,
excludeReplayIframe: true,
excludeReplayShadowDom: true,
excludeReplayWorker: true,
},
}),
compression({ algorithm: 'brotliCompress' }),
],