-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnext.config.ts
More file actions
64 lines (60 loc) · 2.36 KB
/
Copy pathnext.config.ts
File metadata and controls
64 lines (60 loc) · 2.36 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { NextConfig } from "next";
import path from "node:path";
const nextConfig: NextConfig = {
reactStrictMode: false,
// Exclude extensions/ — they are symlinked and Turbopack's filesystem classification
// for that subtree breaks PlainSource::from_source when any diagnostic is emitted.
transpilePackages: ['@changerawr/markdown'],
reactCompiler: {
sources: (filename: string) => !/[/\\]extensions[/\\]/.test(filename),
},
images: {
formats: ["image/avif", "image/webp"],
// No remote patterns needed - avatars are proxied through /api/avatar/[hash]
remotePatterns: [],
},
turbopack: {},
webpack: (config) => {
// Exclude extensions folder from type checking and compilation
config.module = config.module || {};
config.module.rules = config.module.rules || [];
config.module.rules.push({
test: /\.(ts|tsx|js|jsx)$/,
include: [path.join(__dirname, 'extensions')],
use: 'ignore-loader',
});
return config;
},
typescript: {
// Ignore build errors (extensions folder will always have errors)
ignoreBuildErrors: true,
},
experimental: {
// Enable optimized Fast Refresh for faster development
optimizePackageImports: ['lucide-react', '@radix-ui/react-icons', '@heroicons/react'],
// Turbo mode for faster builds
},
typedRoutes: false,
// output: 'standalone', uses next-start, leave commented-out
async headers() {
return [
{
// All page routes (no file extension, not _next/* or /api/*).
// Cloudflare's Rocket Loader rewrites <script> tags in HTML
// responses, which breaks Next's chunk loading
// ("Unexpected token '<'", font OTS errors). `no-transform`
// tells Cloudflare to pass the response through untouched -
// this disables Rocket Loader (and Polish/Auto-Minify) for
// these responses regardless of the zone's dashboard config.
source: '/((?!_next/|api/|.*\\..*).*)',
headers: [
{
key: 'Cache-Control',
value: 'no-transform',
},
],
},
];
},
};
export default nextConfig;