You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// in next.config.mjsimport{fileURLToPath}from"node:url";importcreateJitifrom"jiti";constjiti=createJiti(fileURLToPath(import.meta.url));// Import env here to validate during build. Using jiti we can import .ts files :)jiti("./app/env");/** @type {import('next').NextConfig} */constnextConfig={// HOW TO REWRITE HERE ?// This file is a mjs file so i cannot import env vars from `app/env.ts`
...(process.env.NEXT_PUBLIC_APP_BUILD_MODE==='static-export'&&({output: 'export',})),
...(process.env.NEXT_PUBLIC_APP_BUILD_MODE==='api'&&({asyncheaders(){return[ ... ];},})),};exportdefaultnextConfig;
Is this scenario possible ?
Or I need to convert app/env.ts to js ?
The text was updated successfully, but these errors were encountered:
I need env vars to conditionally define properties in the
nextConfig
.Without
t3-env
I'm doing thisThen following
t3-env
docs I have this:Is this scenario possible ?
Or I need to convert
app/env.ts
to js ?The text was updated successfully, but these errors were encountered: