forked from aws-amplify/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
53 lines (49 loc) · 1.67 KB
/
next.config.js
File metadata and controls
53 lines (49 loc) · 1.67 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
42
43
44
45
46
47
48
49
50
51
52
53
const mdxRenderer = `
import { mdx } from "@mdx-js/react";
`;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const directory = require("./src/directory/directory.js");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const headingLinkPlugin = require("./src/plugins/headings.tsx");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pagePlugin = require("./src/plugins/page.tsx");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const importPlugin = require("./src/plugins/import.tsx");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const codeBlockPlugin = require("./src/plugins/code-block.tsx");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const internalLinkPlugin = require("./src/plugins/internal-link.tsx");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withMDX = require("@next/mdx")({
extension: /\.mdx$/,
options: {
remarkPlugins: [
importPlugin,
headingLinkPlugin,
pagePlugin,
internalLinkPlugin,
],
rehypePlugins: [codeBlockPlugin],
renderer: mdxRenderer,
},
});
module.exports = withMDX({
pageExtensions: ["js", "jsx", "mdx", "tsx", "ts"],
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
future: {
webpack5: true,
},
exportPathMap,
trailingSlash: true,
});
// eslint-disable-next-line @typescript-eslint/no-var-requires
const generatePathMap = require("./generatePathMap.cjs");
function exportPathMap(defaultPathMap, props) {
return generatePathMap(directory);
}