mirror of
https://github.com/cpvalente/ontime.git
synced 2026-07-26 10:38:55 +00:00
refactor: split vendor
This commit is contained in:
committed by
Carlos Valente
parent
85b71627a8
commit
272f788c15
@@ -2,7 +2,6 @@ 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';
|
||||
|
||||
@@ -14,7 +13,6 @@ const isDev = process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'deve
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
splitVendorChunkPlugin(),
|
||||
svgrPlugin(),
|
||||
!isDev &&
|
||||
sentryVitePlugin({
|
||||
@@ -49,6 +47,16 @@ export default defineConfig({
|
||||
build: {
|
||||
outDir: './build',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
// Split vendor code
|
||||
if (id.includes('node_modules')) {
|
||||
return 'vendor';
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user