forked from roadmapsh/deprecated-version
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
61 lines (53 loc) · 1.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');
const rehypePrism = require('@mapbox/rehype-prism')
const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)?$/,
options: {
rehypePlugins: [rehypePrism],
},
});
const options = {
exportPathMap: () => {
// @todo make it dynamic for pages, authors and guides
return {
'/': { page: '/' },
'/about': { page: '/about' },
'/privacy': { page: '/privacy' },
'/terms': { page: '/terms' },
'/roadmaps': { page: '/roadmaps' },
'/guides': { page: '/guides' },
'/frontend': { page: '/[fallback]', query: "frontend" },
'/backend': { page: '/[fallback]', query: "backend" },
'/devops': { page: '/[fallback]', query: "devops" },
'/roadmaps/frontend': { page: '/roadmaps/[roadmap]', query: "frontend" },
'/roadmaps/backend': { page: '/roadmaps/[roadmap]', query: "backend" },
'/roadmaps/devops': { page: '/roadmaps/[roadmap]', query: "devops" },
};
},
// Allow mdx and md files to be pages
pageExtensions: ['jsx', 'js', 'mdx', 'md'],
webpack(config, options) {
// // Transforms SVGs to components
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
// Allow loading images
config.module.rules.push({
test: /\.(png|jpg|gif|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
},
},
});
return config
},
};
//
let nextConfig = withSass(options);
nextConfig = withCSS(nextConfig);
nextConfig = withMDX(nextConfig);
module.exports = nextConfig;