forked from alexpate/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
37 lines (30 loc) · 947 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
const isProd = process.env.NODE_ENV === 'production'
const rehypePrism = require('@mapbox/rehype-prism')
// Adds github.com/mdx-js/mdx to Next.js
const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)?$/,
options: {
hastPlugins: [rehypePrism]
}
})
module.exports = withMDX({
target: 'serverless',
exportTrailingSlash: true,
// Allow mdx and md files to be pages
pageExtensions: ['jsx', 'js', 'mdx', 'md'],
assetPrefix: isProd ? '/docs' : '',
env: {
VERSION: require('./package.json').version,
API_URL: process.env.API_URL,
IMAGE_ASSETS_URL: 'https://assets.zeit.co/image/upload/front',
VIDEO_ASSETS_URL: 'https://assets.zeit.co/video/upload/front',
RAW_ASSETS_URL: 'https://assets.zeit.co/raw/upload/front',
ASSETS: isProd ? '/docs/static' : '/static'
},
webpack(config, { isServer }) {
if (isServer) {
require('./scripts/generate-site-map')
}
return config
}
})