2
0
Files
bot/apps/builder/next.config.mjs

74 lines
1.6 KiB
JavaScript
Raw Normal View History

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} */
const nextConfig = {
2022-08-08 08:21:36 +02:00
reactStrictMode: true,
output: 'standalone',
transpilePackages: [
'@typebot.io/lib',
'@typebot.io/schemas',
'@typebot.io/emails',
'@typebot.io/env',
],
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr', 'pt', 'de'],
},
experimental: {
outputFileTracingRoot: join(__dirname, '../../'),
},
headers: async () => {
return [
{
source: '/(.*)?',
headers: [
{
key: 'X-Frame-Options',
2023-02-13 18:30:29 +01:00
value: 'SAMEORIGIN',
},
],
},
]
},
async rewrites() {
return process.env.NEXT_PUBLIC_POSTHOG_KEY
? [
{
source: '/ingest/:path*',
destination:
(process.env.NEXT_PUBLIC_POSTHOG_HOST ??
'https://app.posthog.com') + '/:path*',
},
]
: []
},
}
2022-02-14 10:57:57 +01:00
const sentryWebpackPluginOptions = {
silent: true,
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder',
2022-02-14 10:57:57 +01:00
}
export default process.env.NEXT_PUBLIC_SENTRY_DSN
? withSentryConfig(
{
...nextConfig,
sentry: {
hideSourceMaps: true,
widenClientFileUpload: true,
},
},
sentryWebpackPluginOptions
)
: nextConfig