forked from keystonejs/keystone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
52 lines (49 loc) · 1.35 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
const withPreconstruct = require('@preconstruct/next');
const withPlugins = require('next-compose-plugins');
const mdxHints = require('remark-hint');
const gfm = require('remark-gfm');
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [mdxHints, gfm],
},
});
const redirectRoutes = require('./redirects.js');
const redirects = {
async redirects() {
return redirectRoutes;
},
};
module.exports = withPlugins([
withPreconstruct,
[
withMDX,
{
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
},
],
nextConfig => {
nextConfig.env = {
siteUrl: 'https://keystonejs.com',
};
nextConfig.eslint = { ignoreDuringBuilds: true };
nextConfig.typescript = {
...nextConfig.typescript,
// we run TS elsewhere, Next runs against a different TS config which it insists on existing
// this is easier than making this the local TS config correct
// + type checking slows down vercel deploys
ignoreBuildErrors: true,
};
const webpack = nextConfig.webpack;
nextConfig.webpack = (_config, args) => {
const config = webpack ? webpack(_config, args) : _config;
const { isServer } = args;
if (!isServer) {
config.resolve.fallback.fs = false;
}
return config;
};
return nextConfig;
},
redirects,
]);