diff --git a/apps/code/vite.main.config.mts b/apps/code/vite.main.config.mts index 03bd66e01..efaa61cfa 100644 --- a/apps/code/vite.main.config.mts +++ b/apps/code/vite.main.config.mts @@ -469,7 +469,7 @@ export default defineConfig(({ mode }) => { copyPosthogPlugin(isDev), copyDrizzleMigrations(), copyCodexAcpBinaries(), - createPosthogPlugin(env), + createPosthogPlugin(env, "posthog-code-main"), ].filter(Boolean), define: { __BUILD_COMMIT__: JSON.stringify(getGitCommit()), diff --git a/apps/code/vite.renderer.config.mts b/apps/code/vite.renderer.config.mts index 423191122..afb4f41b2 100644 --- a/apps/code/vite.renderer.config.mts +++ b/apps/code/vite.renderer.config.mts @@ -19,9 +19,11 @@ export default defineConfig(({ mode }) => { const env = loadEnv(mode, path.resolve(__dirname, "../.."), ""); return { - plugins: [react(), tsconfigPaths(), createPosthogPlugin(env)].filter( - Boolean, - ), + plugins: [ + react(), + tsconfigPaths(), + createPosthogPlugin(env, "posthog-code-renderer"), + ].filter(Boolean), build: { sourcemap: true, }, diff --git a/apps/code/vite.shared.mts b/apps/code/vite.shared.mts index a0260045f..e221cf869 100644 --- a/apps/code/vite.shared.mts +++ b/apps/code/vite.shared.mts @@ -7,6 +7,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); export function createPosthogPlugin( env: Record, + project: string, ): Plugin | null { if (!env.POSTHOG_SOURCEMAP_API_KEY || !env.POSTHOG_ENV_ID) { return null; @@ -16,7 +17,7 @@ export function createPosthogPlugin( envId: env.POSTHOG_ENV_ID, host: env.POSTHOG_HOST, sourcemaps: { - team: "posthog-code", + project, deleteAfterUpload: true, }, });