forked from daneden/daneden.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
48 lines (44 loc) · 1.13 KB
/
next.config.js
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
const prism = require("@mapbox/rehype-prism")
const slug = require("rehype-slug")
const smartypants = require("@ngsctt/remark-smartypants")
const toc = require("remark-toc")
const withMDXEnhanced = require("next-mdx-enhanced")
const withMDXFm = require("next-mdx-frontmatter")
const withPlugins = require("next-compose-plugins")
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
const mdxOptions = {
layoutPath: "layouts",
defaultLayout: true,
fileExtensions: ["mdx"],
remarkPlugins: [smartypants, toc],
rehypePlugins: [prism, slug],
}
module.exports = withPlugins(
[withMDXFm, withBundleAnalyzer],
withMDXEnhanced(mdxOptions)({
env: {
VERCEL_URL: process.env.VERCEL_URL || "daneden.me",
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.node = {
fs: "empty",
}
}
config.module.rules = [
...config.module.rules,
{
test: /\.(ttf)$/i,
use: [
{
loader: "file-loader",
},
],
},
]
return config
},
})
)