-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathnext.config.ts
More file actions
36 lines (29 loc) · 1.06 KB
/
next.config.ts
File metadata and controls
36 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import type { NextConfig } from "next";
import nextBundleAnalyzer from "@next/bundle-analyzer";
import { withContentCollections } from "@content-collections/next";
import { withLingo } from "@lingo.dev/compiler/next";
import { createLingoConfig } from "./lingo.config";
import { getRemotePatterns } from "./next-images.config";
(globalThis as typeof globalThis & { AI_SDK_LOG_WARNINGS?: false })
.AI_SDK_LOG_WARNINGS = false;
process.env.DOTENV_CONFIG_QUIET = "true";
const nextConfig: NextConfig = {
experimental: {},
images: {
remotePatterns: getRemotePatterns(),
},
};
function withOptionalBundleAnalyzer(config: NextConfig): NextConfig {
if (process.env.ANALYZE !== "true") {
return config;
}
const withBundleAnalyzer = nextBundleAnalyzer({
enabled: true,
});
return withBundleAnalyzer(config);
}
export default async function createNextConfig(): Promise<NextConfig> {
let config = await withLingo(nextConfig, createLingoConfig());
config = withOptionalBundleAnalyzer(config);
return (await withContentCollections(config)) as NextConfig;
}