add code chunking to vite.config.ts

This commit is contained in:
Amruth Pillai
2024-05-07 11:45:33 +02:00
parent e21430a421
commit e3785030e1
11 changed files with 616 additions and 707 deletions

View File

@ -24,9 +24,9 @@ if (import.meta.env.VITE_CLIENT_SENTRY_DSN) {
}),
Sentry.replayIntegration(),
],
tracesSampleRate: 0.5,
replaysOnErrorSampleRate: 0.5,
replaysSessionSampleRate: 0.25,
tracesSampleRate: 1,
replaysOnErrorSampleRate: 1,
replaysSessionSampleRate: 1,
});
}

View File

@ -4,6 +4,7 @@
declare const appVersion: string;
interface ImportMetaEnv {
SENTRY_AUTH_TOKEN: string | undefined;
VITE_CLIENT_SENTRY_DSN: string | undefined;
VITE_DISABLE_SIGNUPS: string | undefined;
}

View File

@ -1,9 +1,11 @@
/// <reference types='vitest' />
import { lingui } from "@lingui/vite-plugin";
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import react from "@vitejs/plugin-react";
import { defineConfig, searchForWorkspaceRoot } from "vite";
import { chunkSplitPlugin } from "vite-plugin-chunk-split";
export default defineConfig({
cacheDir: "../../node_modules/.vite/client",
@ -39,7 +41,11 @@ export default defineConfig({
}),
lingui(),
nxViteTsPaths(),
chunkSplitPlugin({
strategy: "unbundle",
}),
sentryVitePlugin({
disable: process.env.SENTRY_AUTH_TOKEN === undefined,
org: "reactive-resume",
project: "client",
}),