-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
46 lines (44 loc) 路 1012 Bytes
/
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
const readingTime = require('reading-time')
const mdxPrism = require('mdx-prism')
const withMdxEnhanced = require('next-mdx-enhanced')
module.exports = withMdxEnhanced({
layoutPath: 'layouts',
defaultLayout: true,
remarkPlugins: [
require('remark-slug'),
[
require('remark-autolink-headings'),
{
linkProperties: { className: 'heading-link' },
behavior: 'wrap',
},
],
require('remark-code-titles'),
],
rehypePlugins: [mdxPrism],
extendFrontMatter: {
process: (mdxContent) => ({
readingTime: readingTime(mdxContent),
}),
},
})({
images: {
domains: ['source.unsplash.com'],
},
async redirects() {
return [
{
source: '/s/:shortcode',
destination: '/api/short/:shortcode',
permanent: true,
},
]
},
webpack: (config, { isServer }) => {
if (isServer) {
const generateSitemap = require('./scripts/generate-sitemap')
generateSitemap()
}
return config
},
})