2023-08-28 09:13:53 +02:00
|
|
|
import { withSentryConfig } from '@sentry/nextjs'
|
|
|
|
import { join, dirname } from 'path'
|
|
|
|
import '@typebot.io/env/dist/env.mjs'
|
|
|
|
import { configureRuntimeEnv } from 'next-runtime-env/build/configure.js'
|
|
|
|
import { fileURLToPath } from 'url'
|
|
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
|
|
|
|
|
|
const __dirname = dirname(__filename)
|
|
|
|
|
|
|
|
configureRuntimeEnv()
|
2022-02-14 10:57:57 +01:00
|
|
|
|
2022-08-08 08:21:36 +02:00
|
|
|
/** @type {import('next').NextConfig} */
|
2023-03-15 08:35:16 +01:00
|
|
|
const nextConfig = {
|
2022-08-08 08:21:36 +02:00
|
|
|
reactStrictMode: true,
|
|
|
|
output: 'standalone',
|
2023-03-15 08:35:16 +01:00
|
|
|
transpilePackages: [
|
|
|
|
'@typebot.io/lib',
|
|
|
|
'@typebot.io/schemas',
|
|
|
|
'@typebot.io/emails',
|
2023-08-28 09:13:53 +02:00
|
|
|
'@typebot.io/env',
|
2023-03-15 08:35:16 +01:00
|
|
|
],
|
2023-03-11 11:05:07 +01:00
|
|
|
i18n: {
|
|
|
|
defaultLocale: 'en',
|
2023-09-05 18:36:22 +02:00
|
|
|
locales: ['en', 'fr', 'pt', 'pt-BR', 'de'],
|
2023-03-11 11:05:07 +01:00
|
|
|
},
|
2022-03-12 07:53:37 +01:00
|
|
|
experimental: {
|
2023-08-28 09:13:53 +02:00
|
|
|
outputFileTracingRoot: join(__dirname, '../../'),
|
2022-03-12 07:53:37 +01:00
|
|
|
},
|
2023-01-18 20:56:48 +01:00
|
|
|
headers: async () => {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: '/(.*)?',
|
|
|
|
headers: [
|
|
|
|
{
|
|
|
|
key: 'X-Frame-Options',
|
2023-02-13 18:30:29 +01:00
|
|
|
value: 'SAMEORIGIN',
|
2023-01-18 20:56:48 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2023-08-29 10:01:28 +02:00
|
|
|
async rewrites() {
|
|
|
|
return process.env.NEXT_PUBLIC_POSTHOG_KEY
|
|
|
|
? [
|
|
|
|
{
|
|
|
|
source: '/ingest/:path*',
|
|
|
|
destination:
|
|
|
|
(process.env.NEXT_PUBLIC_POSTHOG_HOST ??
|
|
|
|
'https://app.posthog.com') + '/:path*',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []
|
|
|
|
},
|
2023-03-15 08:35:16 +01:00
|
|
|
}
|
2022-02-14 10:57:57 +01:00
|
|
|
|
|
|
|
const sentryWebpackPluginOptions = {
|
|
|
|
silent: true,
|
2023-02-06 09:48:48 +01:00
|
|
|
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder',
|
2022-02-14 10:57:57 +01:00
|
|
|
}
|
|
|
|
|
2023-08-28 09:13:53 +02:00
|
|
|
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
2022-12-20 10:05:30 +01:00
|
|
|
? withSentryConfig(
|
|
|
|
{
|
|
|
|
...nextConfig,
|
|
|
|
sentry: {
|
|
|
|
hideSourceMaps: true,
|
2023-02-14 15:09:05 +01:00
|
|
|
widenClientFileUpload: true,
|
2022-12-20 10:05:30 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
sentryWebpackPluginOptions
|
|
|
|
)
|
|
|
|
: nextConfig
|