-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
55 lines (50 loc) · 1.2 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
// @ts-check
const { withContentCollections } = require("@content-collections/next");
const nextRoutes = require("nextjs-routes/config");
// @ts-ignore
const withRoutes = nextRoutes();
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
experimental: {
scrollRestoration: true,
// nextjs incremental page building fails with phosphor icons unless we do this
// https://github.com/phosphor-icons/react/issues/45
optimizePackageImports: ["@phosphor-icons/react"],
},
transpilePackages: [
"react-syntax-highlighter",
"@content-collections/mdx",
"mdx-bundler",
],
i18n: {
locales: ["en"],
defaultLocale: "en",
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: [
{
name: "removeViewBox",
active: false,
},
],
},
},
},
],
});
return config;
},
};
module.exports = withRoutes(
withContentCollections(nextConfig)
);