-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
56 lines (51 loc) · 1.38 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
// this file is not transpiled using babel
// it should work in your node.js environment with no additional changes
const createConfig = () => {
/** @type {import('next').NextConfig} */
const nextConfig = {
poweredByHeader: false,
images: {
domains: ["codedrift.com", "localhost"],
},
experimental: { esmExternals: true },
webpack: (webpackConfig, { webpack }) => {
// allow .js to resolve to valid extensions
webpackConfig.resolve.extensionAlias = {
".js": [".ts", ".tsx", ".js", ".jsx"],
".mjs": [".mts", ".mjs"],
".cjs": [".cts", ".cjs"],
};
// // allow loading of .node files (such as sharp)
// webpackConfig.module.rules.push({
// test: /\.node$/,
// loader: "node-loader",
// });
return webpackConfig;
},
async redirects() {
return [
{
source: "/support",
destination: "/help",
permanent: true,
},
];
},
async rewrites() {
return [
{
source: "/notes/",
destination:
"https://publish.obsidian.md/serve?url=codedrift.com/notes",
},
{
source: "/notes/:path*",
destination:
"https://publish.obsidian.md/serve?url=codedrift.com/notes/:path*",
},
];
},
};
return nextConfig;
};
export default createConfig;