-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
41 lines (37 loc) · 1.02 KB
/
next.config.mjs
File metadata and controls
41 lines (37 loc) · 1.02 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
import createMDX from "@next/mdx";
import rehypeShiki from "@shikijs/rehype";
import remarkMath from 'remark-math'
import rehypeTypst from "@myriaddreamin/rehype-typst";
import remarkGfm from 'remark-gfm'
import bundler from '@next/bundle-analyzer'
/** @type {import('next').NextConfig} */
const isGithubPages = process.env.NODE_ENV === 'production';
const withBundleAnalyzer = bundler({
enabled: process.env.ANALYZE === 'true',
});
const nextConfig = {
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
trailingSlash: true,
assetPrefix: isGithubPages ?"/draftkit" : "",
};
if (isGithubPages) {
nextConfig.output = "export";
nextConfig.images = { unoptimized: false };
nextConfig.basePath = "/draftkit";
}
const withMDX = createMDX({
// extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkMath, remarkGfm],
rehypePlugins: [
rehypeTypst,
[
rehypeShiki,
{
theme: "dark-plus",
},
],
],
},
});
export default withMDX(withBundleAnalyzer(nextConfig));