-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
42 lines (39 loc) · 954 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
42
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
module.exports = withBundleAnalyzer({
webpack(config, { dev, isServer }) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
})
// Replace React with Preact only in client production build
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
react: "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat",
})
}
return config
},
i18n: {
locales: ["en-US"],
defaultLocale: "en-US",
},
images: {
formats: ["image/avif", "image/webp"],
},
async rewrites() {
return [
{
source: "/bee.js",
destination: "https://cdn.splitbee.io/sb.js",
},
{
source: "/_hive/:slug",
destination: "https://hive.splitbee.io/:slug",
},
]
},
})