-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
next.config.js
49 lines (49 loc) · 1.22 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
const { withPlausibleProxy } = require("next-plausible");
const withPWA = require("next-pwa")({
dest: "public",
disable: process.env.NODE_ENV === "development",
register: true,
});
module.exports = withPlausibleProxy()(
withPWA({
output: "standalone",
reactStrictMode: false, //true
swcMinify: true,
compiler: {
removeConsole: process.env.NODE_ENV !== "development",
},
images: {
domains: [],
},
experimental: {
scrollRestoration: true,
},
async redirects() {
return [
{
source: "/user/:path*",
destination: "/u/:path*",
permanent: true,
},
{ source: "/comments/:path*", destination: "/:path*", permanent: true },
{
source: "/r/:sub/w/:page*",
destination: "/r/:sub/wiki/:page*",
permanent: true,
},
];
},
async rewrites() {
return [
{
source: "/js/script.js",
destination: "https://plausible.io/js/plausible.js",
},
{
source: "/api/event", // Or '/api/event/' if you have `trailingSlash: true` in this config
destination: "https://plausible.io/api/event",
},
];
},
})
);