🧑💻 Improve env variables type safety and management (#718)
Closes #679
This commit is contained in:
61
apps/builder/next.config.mjs
Normal file
61
apps/builder/next.config.mjs
Normal file
@ -0,0 +1,61 @@
|
||||
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()
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
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',
|
||||
value: 'SAMEORIGIN',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
const sentryWebpackPluginOptions = {
|
||||
silent: true,
|
||||
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder',
|
||||
}
|
||||
|
||||
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
||||
? withSentryConfig(
|
||||
{
|
||||
...nextConfig,
|
||||
sentry: {
|
||||
hideSourceMaps: true,
|
||||
widenClientFileUpload: true,
|
||||
},
|
||||
},
|
||||
sentryWebpackPluginOptions
|
||||
)
|
||||
: nextConfig
|
Reference in New Issue
Block a user