mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 00:03:27 +10:00
add code chunking to vite.config.ts
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import { defineConfig, searchForWorkspaceRoot } from "vite";
|
||||
import { chunkSplitPlugin } from "vite-plugin-chunk-split";
|
||||
|
||||
export default defineConfig({
|
||||
base: "/artboard/",
|
||||
@ -20,7 +21,13 @@ export default defineConfig({
|
||||
fs: { allow: [searchForWorkspaceRoot(process.cwd())] },
|
||||
},
|
||||
|
||||
plugins: [react(), nxViteTsPaths()],
|
||||
plugins: [
|
||||
react(),
|
||||
nxViteTsPaths(),
|
||||
chunkSplitPlugin({
|
||||
strategy: "unbundle",
|
||||
}),
|
||||
],
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
1
apps/client/src/vite-env.d.ts
vendored
1
apps/client/src/vite-env.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
@ -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",
|
||||
}),
|
||||
|
||||
@ -70,6 +70,12 @@ export class AuthService {
|
||||
}
|
||||
}
|
||||
|
||||
async setLastSignedIn(email: string) {
|
||||
await this.userService.updateByEmail(email, {
|
||||
secrets: { update: { lastSignedIn: new Date() } },
|
||||
});
|
||||
}
|
||||
|
||||
async setRefreshToken(email: string, token: string | null) {
|
||||
await this.userService.updateByEmail(email, {
|
||||
secrets: {
|
||||
@ -129,6 +135,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
await this.validatePassword(password, user.secrets.password);
|
||||
await this.setLastSignedIn(user.email);
|
||||
|
||||
return user;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user