-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
41 lines (36 loc) · 986 Bytes
/
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
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});
module.exports = withNextra({
env: {
GITHUB_ACCESS_TOKEN: process.env.GITHUB_ACCESS_TOKEN,
},
async redirects() {
return [
{
source: "/live_pages", // old URL
destination: "/all_pages", // new URL
permanent: true, // permanent 308
},
{
source: "/ecosystem/dev_shops", // old URL
destination: "/development/dev_teams", // new URL
permanent: true, // permanent 308
},
];
},
webpack(config) {
const allowedSvgRegex = /components\/icons\/.+\.svg$/;
const fileLoaderRule = config.module.rules.find((rule) => {
const testRegex = new RegExp(".svg");
return testRegex.test(rule.test);
});
fileLoaderRule.exclude = allowedSvgRegex;
config.module.rules.push({
test: allowedSvgRegex,
use: ["@svgr/webpack"],
});
return config;
},
});