Skip to content

Commit 35dc281

Browse files
committed
chore: debug next config
1 parent 4d40ddf commit 35dc281

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

apps/web/next.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { env } from '@repo/env'
66
import createNextIntlPlugin from 'next-intl/plugin'
77

88
import { IS_PRODUCTION } from '@/lib/constants'
9+
import { withPostHog } from '@/lib/posthog'
910

1011
const 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))))

apps/web/src/lib/posthog.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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'
44
import { env } from '@repo/env'
55
import { 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+
}

0 commit comments

Comments
 (0)