-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
64 lines (59 loc) · 1.63 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
53
54
55
56
57
58
59
60
61
62
63
64
const withPrismaPlugin = require("next-prisma-plugin-webpack5");
const intercept = require("intercept-stdout");
module.exports = withPrismaPlugin({
webpackDevMiddleware: (config) => {
if (process.env.IS_DOCKER) {
// "next dev" in Docker doesn't reliably pick up file changes, so we need to enable polling
// see https://github.com/vercel/next.js/issues/6417 and https://webpack.js.org/configuration/watch/
config.watchOptions = {
...config.watchOptions,
poll: 500,
};
}
return config;
},
});
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer({
staticPageGenerationTimeout: 300,
images: {
domains: [
"www.notion.so",
"notion.so",
"images.unsplash.com",
"pbs.twimg.com",
],
formats: ["image/avif", "image/webp"],
},
});
module.exports = {
reactStrictMode: true,
experimental: {
scrollRestoration: true,
},
async rewrites() {
return [
{
source: "/s/:any*",
destination: "/app",
},
{
source: "/sb.js",
destination: "https://cdn.splitbee.io/sb.js",
},
{
source: "/sb-api/:slug",
destination: "https://hive.splitbee.io/:slug",
},
];
},
i18n: {
locales: ["en"],
defaultLocale: "en",
},
};
// Surpress warning for duplicate atom key – See this issue for more info https://github.com/facebookexperimental/Recoil/issues/733
intercept((text) => (text.includes("Duplicate atom key") ? "" : text));