-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.mjs
More file actions
57 lines (54 loc) · 1.73 KB
/
next.config.mjs
File metadata and controls
57 lines (54 loc) · 1.73 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
import { createMDX } from "fumadocs-mdx/next";
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
// Force shiki to be bundled into the server build instead of being treated
// as an external module (Next.js default). Cloudflare Workers cannot resolve
// hashed external module ids at runtime.
transpilePackages: ["shiki"],
experimental: {
optimizePackageImports: ["lucide-react", "@heroicons/react"],
},
// Turbopack config: alias shiki subpath imports to concrete file paths so they
// get bundled instead of externalized (Cloudflare Workers can't resolve hashed external modules)
turbopack: {
resolveAlias: {
shiki: "./node_modules/shiki/dist/index.mjs",
"shiki/core": "./node_modules/shiki/dist/core-unwasm.mjs",
"shiki/engine/javascript":
"./node_modules/shiki/dist/engine-javascript.mjs",
"shiki/engine/oniguruma":
"./node_modules/shiki/dist/engine-oniguruma.mjs",
"shiki/wasm": "./node_modules/shiki/dist/wasm.mjs",
},
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "github.com",
},
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
},
{
protocol: "https",
hostname: "raw.githubusercontent.com",
},
],
// Allow SVG images through the optimization pipeline (extension icons may be SVG).
// CSP headers (script-src 'none'; frame-src 'none'; sandbox;) are applied automatically.
dangerouslyAllowSVG: true,
},
async rewrites() {
return [
{
source: "/docs/:path*.mdx",
destination: "/llms.mdx/docs/:path*",
},
];
},
};
export default withMDX(config);