-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
34 lines (30 loc) · 910 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
import nextra from "nextra";
const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.jsx",
defaultShowCopyCode: true,
staticImage: true,
flexsearch: {
codeblocks: false,
},
});
export default withNextra({
output: "export",
images: { unoptimized: true },
webpack(config) {
const allowedSvgRegex = /\/components\/svg\/.+\.svg$/;
const fileLoaderRule = config.module.rules.find((rule) => {
return rule.test instanceof RegExp && rule.test.test(".svg");
});
fileLoaderRule.exclude = allowedSvgRegex;
// These rule allows importing SVGs as React components,
// but breaks the ability to use SVGs as background images in CSS,
// which Next.js handles by default.
config.module.rules.push({
test: allowedSvgRegex,
use: ["@svgr/webpack"],
});
return config;
},
transpilePackages: ["lucide-react"],
});