revert bundle change
This commit is contained in:
@@ -3,7 +3,30 @@ import tailwindcss from "@tailwindcss/vite";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss()]
|
plugins: [tailwindcss()],
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: (id) => {
|
||||||
|
// Bundle highlight.js and lowlight together
|
||||||
|
if (id.includes("highlight.js") || id.includes("lowlight")) {
|
||||||
|
return "highlight";
|
||||||
|
}
|
||||||
|
// Bundle Mermaid separately (large library, only used on some posts)
|
||||||
|
if (id.includes("mermaid")) {
|
||||||
|
return "mermaid";
|
||||||
|
}
|
||||||
|
// Bundle all Tiptap extensions together (only used in editor)
|
||||||
|
if (id.includes("@tiptap") || id.includes("solid-tiptap")) {
|
||||||
|
return "tiptap";
|
||||||
|
}
|
||||||
|
if (id.includes("motion") || id.includes("@motionone")) {
|
||||||
|
return "motion";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
preset: "vercel"
|
preset: "vercel"
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ import {
|
|||||||
getPathAnalytics,
|
getPathAnalytics,
|
||||||
cleanupOldAnalytics,
|
cleanupOldAnalytics,
|
||||||
logVisit,
|
logVisit,
|
||||||
getPerformanceStats
|
getPerformanceStats,
|
||||||
|
enrichAnalyticsEntry
|
||||||
} from "~/server/analytics";
|
} from "~/server/analytics";
|
||||||
import { ConnectionFactory } from "~/server/database";
|
import { ConnectionFactory } from "~/server/database";
|
||||||
|
import { v4 as uuid } from "uuid";
|
||||||
|
import { getRequestIP, getCookie } from "vinxi/http";
|
||||||
|
|
||||||
export const analyticsRouter = createTRPCRouter({
|
export const analyticsRouter = createTRPCRouter({
|
||||||
logPerformance: publicProcedure
|
logPerformance: publicProcedure
|
||||||
@@ -66,9 +69,6 @@ export const analyticsRouter = createTRPCRouter({
|
|||||||
action: "updated"
|
action: "updated"
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const { v4: uuid } = await import("uuid");
|
|
||||||
const { enrichAnalyticsEntry } = await import("~/server/analytics");
|
|
||||||
|
|
||||||
const req = ctx.event.nativeEvent.node?.req || ctx.event.nativeEvent;
|
const req = ctx.event.nativeEvent.node?.req || ctx.event.nativeEvent;
|
||||||
const userAgent =
|
const userAgent =
|
||||||
req.headers?.["user-agent"] ||
|
req.headers?.["user-agent"] ||
|
||||||
@@ -79,9 +79,7 @@ export const analyticsRouter = createTRPCRouter({
|
|||||||
req.headers?.referrer ||
|
req.headers?.referrer ||
|
||||||
ctx.event.request?.headers?.get("referer") ||
|
ctx.event.request?.headers?.get("referer") ||
|
||||||
undefined;
|
undefined;
|
||||||
const { getRequestIP } = await import("vinxi/http");
|
|
||||||
const ipAddress = getRequestIP(ctx.event.nativeEvent) || undefined;
|
const ipAddress = getRequestIP(ctx.event.nativeEvent) || undefined;
|
||||||
const { getCookie } = await import("vinxi/http");
|
|
||||||
const sessionId =
|
const sessionId =
|
||||||
getCookie(ctx.event.nativeEvent, "session_id") || undefined;
|
getCookie(ctx.event.nativeEvent, "session_id") || undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,17 @@ import { z } from "zod";
|
|||||||
import { getAuthSession } from "~/server/session-helpers";
|
import { getAuthSession } from "~/server/session-helpers";
|
||||||
import { logAuditEvent } from "~/server/audit";
|
import { logAuditEvent } from "~/server/audit";
|
||||||
import { getClientIP, getUserAgent } from "~/server/security";
|
import { getClientIP, getUserAgent } from "~/server/security";
|
||||||
|
import { generatePasswordSetEmail } from "~/server/email-templates";
|
||||||
|
import { formatDeviceDescription } from "~/server/device-utils";
|
||||||
|
import sendEmail from "~/server/email";
|
||||||
|
import {
|
||||||
|
updateEmailSchema,
|
||||||
|
updateDisplayNameSchema,
|
||||||
|
updateProfileImageSchema,
|
||||||
|
changePasswordSchema,
|
||||||
|
setPasswordSchema,
|
||||||
|
deleteAccountSchema
|
||||||
|
} from "../schemas/user";
|
||||||
|
|
||||||
export const userRouter = createTRPCRouter({
|
export const userRouter = createTRPCRouter({
|
||||||
getProfile: publicProcedure.query(async ({ ctx }) => {
|
getProfile: publicProcedure.query(async ({ ctx }) => {
|
||||||
@@ -242,12 +253,6 @@ export const userRouter = createTRPCRouter({
|
|||||||
// Send email notification about password being set
|
// Send email notification about password being set
|
||||||
if (user.email) {
|
if (user.email) {
|
||||||
try {
|
try {
|
||||||
const { generatePasswordSetEmail } =
|
|
||||||
await import("~/server/email-templates");
|
|
||||||
const { formatDeviceDescription } =
|
|
||||||
await import("~/server/device-utils");
|
|
||||||
const { default: sendEmail } = await import("~/server/email");
|
|
||||||
|
|
||||||
const h3Event = ctx.event.nativeEvent
|
const h3Event = ctx.event.nativeEvent
|
||||||
? ctx.event.nativeEvent
|
? ctx.event.nativeEvent
|
||||||
: (ctx.event as any);
|
: (ctx.event as any);
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
export { checkAuthStatus, validateLineageRequest } from "./auth";
|
// Dynamic import to avoid bundler warnings - auth.ts is already dynamically imported elsewhere
|
||||||
|
export async function checkAuthStatus(
|
||||||
|
...args: Parameters<typeof import("./auth").checkAuthStatus>
|
||||||
|
) {
|
||||||
|
const { checkAuthStatus: fn } = await import("./auth");
|
||||||
|
return fn(...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function validateLineageRequest(
|
||||||
|
...args: Parameters<typeof import("./auth").validateLineageRequest>
|
||||||
|
) {
|
||||||
|
const { validateLineageRequest: fn } = await import("./auth");
|
||||||
|
return fn(...args);
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ConnectionFactory,
|
ConnectionFactory,
|
||||||
|
|||||||
Reference in New Issue
Block a user