forked from prompt-engineering/click-prompt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
61 lines (57 loc) · 1.47 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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
// TODO https://beta.nextjs.org/docs/configuring/typescript#statically-typed-links
// typedRoutes: true,
},
trailingSlash: true,
transpilePackages: ["react-syntax-highlighter"],
images: {
domains: ["prompt-engineering.github.io"],
},
async redirects() {
return [
{
source: "/zh-CN/chatgpt-startling-by-each-step/:id/",
destination: "/zh-CN/chatgpt-flow/:id/",
permanent: true,
},
{
source: "/en-US/chatgpt-startling-by-each-step/:id/",
destination: "/en-US/chatgpt-flow/:id/",
permanent: true,
},
{
source: "/zh-CN/chatgpt-flow/:id/",
destination: "/zh-CN/click-flow/:id/",
permanent: true,
},
{
source: "/en-US/chatgpt-flow/:id/",
destination: "/en-US/click-flow/:id/",
permanent: true,
},
];
},
webpack: (config, options) => {
config.module.rules.push({
test: /\.yml/,
use: "yaml-loader",
});
config.module.rules.push({
test: /\.svg$/i,
type: "asset",
resourceQuery: /url/, // *.svg?url
});
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url
use: ["@svgr/webpack"],
});
return config;
},
};
module.exports = nextConfig;