forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
40 lines (35 loc) · 1.31 KB
/
next.config.mjs
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
import nextra from 'nextra';
import remarkGfm from 'remark-gfm';
import getNextData from './next.data.mjs';
const withNextra = nextra({
theme: 'theme.tsx',
flexsearch: false,
codeHighlight: false,
mdxOptions: { format: 'detect', remarkPlugins: [remarkGfm] },
transform: getNextData,
transformPageOpts: pageOpts => {
delete pageOpts.pageMap;
delete pageOpts.headings;
delete pageOpts.timestamp;
return pageOpts;
},
});
// This is used for telling Next.js to to a Static Export Build of the Website
// This is used for static/without a Node.js server hosting, such as on our
// legacy Website Build Environment on Node.js's DigitalOcean Droplet.
// Note.: Image optimization is also disabled through this process
const enableStaticExport = process.env.NEXT_STATIC_EXPORT === 'true';
// Supports a manuall override of the base path of the website
// This is useful when running the deployment on a subdirectory
// of a domain, such as when hosted on GitHub Pages.
const basePath = String(process.env.NEXT_BASE_PATH || '');
export default withNextra({
basePath,
trailingSlash: false,
outputFileTracing: false,
distDir: enableStaticExport ? 'build' : '.next',
output: enableStaticExport ? 'export' : undefined,
images: { unoptimized: enableStaticExport },
eslint: { dirs: ['.'] },
i18n: null,
});