| 1234567891011121314151617181920212223242526 |
- import type { NextConfig } from "next";
- import { existsSync, readFileSync } from "node:fs";
- import { resolve } from "node:path";
- // Load .env from monorepo root at build/start time
- const envPath = resolve(import.meta.dirname, "../../.env");
- const envVars: Record<string, string> = {};
- if (existsSync(envPath)) {
- const content = readFileSync(envPath, "utf-8");
- for (const line of content.split("\n")) {
- const trimmed = line.trim();
- if (!trimmed || trimmed.startsWith("#")) continue;
- const eq = trimmed.indexOf("=");
- if (eq < 0) continue;
- const key = trimmed.slice(0, eq).trim();
- const val = trimmed.slice(eq + 1).trim();
- envVars[key] = val;
- }
- }
- const nextConfig: NextConfig = {
- transpilePackages: ["@pipeline/shared", "@pipeline/core", "@pipeline/tts"],
- env: envVars,
- };
- export default nextConfig;
|