-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
36 lines (31 loc) · 961 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
// next.config.js
// https://nextjs.org/docs/api-reference/next.config.js/introduction
const path = require('path');
// https://mdxjs.com/getting-started/next
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
},
});
const nextConfig = {
pageExtensions: ['js', 'jsx', 'md', 'mdx'],
webpack: (config, { isServer }) => {
// Define path aliases
config.resolve.alias['@components'] = path.join(
__dirname,
'components'
);
config.resolve.alias['@styles'] = path.join(__dirname, 'styles');
config.resolve.alias['@utils'] = path.join(__dirname, 'utils');
if (!isServer) {
// Fallbacks for Node.js modules required by MDX
config.resolve.fallback = {
fs: false,
};
}
return config;
},
};
module.exports = withMDX(nextConfig);