File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { env } from '@repo/env'
66import createNextIntlPlugin from 'next-intl/plugin'
77
88import { IS_PRODUCTION } from '@/lib/constants'
9+ import { withPostHog } from '@/lib/posthog'
910
1011const withNextIntl = createNextIntlPlugin ( )
1112
@@ -134,4 +135,9 @@ const config: NextConfig = {
134135 }
135136}
136137
137- export default withContentCollections ( withNextIntl ( withBundleAnalyzer ( config ) ) )
138+ console . log ( withPostHog ( config ) )
139+ console . log ( withBundleAnalyzer ( withPostHog ( config ) ) )
140+ console . log ( withNextIntl ( withBundleAnalyzer ( withPostHog ( config ) ) ) )
141+ console . log ( withContentCollections ( withNextIntl ( withBundleAnalyzer ( withPostHog ( config ) ) ) ) )
142+
143+ export default withContentCollections ( withNextIntl ( withBundleAnalyzer ( withPostHog ( config ) ) ) )
Original file line number Diff line number Diff line change 1- // import type { NextConfig } from 'next'
1+ import type { NextConfig } from 'next'
22
3- // import { withPostHogConfig } from '@posthog/nextjs-config'
3+ import { withPostHogConfig } from '@posthog/nextjs-config'
44import { env } from '@repo/env'
55import { PostHog } from 'posthog-node'
66
@@ -20,14 +20,14 @@ export const getPostHogServer = () => {
2020 return posthogInstance
2121}
2222
23- // export const withPostHog = (nextConfig: NextConfig): NextConfig => {
24- // if (!env.POSTHOG_API_KEY || !env.POSTHOG_ENV_ID || !env.NEXT_PUBLIC_POSTHOG_HOST) {
25- // return nextConfig
26- // }
23+ export const withPostHog = ( nextConfig : NextConfig ) : NextConfig => {
24+ if ( ! env . POSTHOG_API_KEY || ! env . POSTHOG_ENV_ID || ! env . NEXT_PUBLIC_POSTHOG_HOST ) {
25+ return nextConfig
26+ }
2727
28- // return withPostHogConfig(nextConfig, {
29- // personalApiKey: env.POSTHOG_API_KEY,
30- // envId: env.POSTHOG_ENV_ID,
31- // host: env.NEXT_PUBLIC_POSTHOG_HOST
32- // })
33- // }
28+ return withPostHogConfig ( nextConfig , {
29+ personalApiKey : env . POSTHOG_API_KEY ,
30+ envId : env . POSTHOG_ENV_ID ,
31+ host : env . NEXT_PUBLIC_POSTHOG_HOST
32+ } )
33+ }
You can’t perform that action at this time.
0 commit comments