mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
chore: split vendor bundle (#740)
This commit is contained in:
@@ -2,6 +2,7 @@ import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import { fileURLToPath, URL } from 'node:url';
|
import { fileURLToPath, URL } from 'node:url';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
import { splitVendorChunkPlugin } from 'vite';
|
||||||
import { compression } from 'vite-plugin-compression2';
|
import { compression } from 'vite-plugin-compression2';
|
||||||
import svgrPlugin from 'vite-plugin-svgr';
|
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({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
|
splitVendorChunkPlugin(),
|
||||||
svgrPlugin(),
|
svgrPlugin(),
|
||||||
!isDev &&
|
!isDev &&
|
||||||
sentryVitePlugin({
|
sentryVitePlugin({
|
||||||
@@ -24,6 +26,12 @@ export default defineConfig({
|
|||||||
deploy: {
|
deploy: {
|
||||||
env: 'production',
|
env: 'production',
|
||||||
},
|
},
|
||||||
|
bundleSizeOptimizations: {
|
||||||
|
excludeDebugStatements: true,
|
||||||
|
excludeReplayIframe: true,
|
||||||
|
excludeReplayShadowDom: true,
|
||||||
|
excludeReplayWorker: true,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
compression({ algorithm: 'brotliCompress' }),
|
compression({ algorithm: 'brotliCompress' }),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user