-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
58 lines (50 loc) · 1.28 KB
/
next.config.js
File metadata and controls
58 lines (50 loc) · 1.28 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
54
55
56
57
58
// write webpack config to debug/analyze it
const fs = require('node:fs');
const createNextIntlPlugin = require('next-intl/plugin');
const createMDX = require('@next/mdx');
function writeToFile(obj, fileName) {
try {
fs.writeFileSync(`.debug/${fileName}`, JSON.stringify(obj));
// file written successfully
} catch (err) {
console.error(err);
}
}
// add this to be able to serialize the webpack config and options
BigInt.prototype['toJSON'] = function () {
return this.toString();
}
/*
Add this to nextConfig to debug WebPack:
webpack: function (config, options) {
writeToFile(config, 'webpack-config.json');
writeToFile(options, 'webpack-options.json');
return config;
},
*/
// @type { import('next').NextConfig }
const nextConfig = {
output: "standalone",
// Configure `pageExtensions` to include markdown and MDX files
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
experimental: {
typedRoutes: true,
},
async redirects() {
return [
// Basic redirect
{
source: '/',
destination: '/home',
permanent: true,
},
]
},
}
const withMDX = createMDX({
// Add markdown plugins here, as desired
})
const withNextIntl = createNextIntlPlugin();
module.exports = withMDX(
withNextIntl(nextConfig)
);