-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
next.config.js
31 lines (29 loc) · 760 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
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer({
swcMinify: true,
webpack(config, { dev, isServer }) {
// 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;
},
async rewrites() {
return [
{
source: "/bee.js",
destination: "https://cdn.splitbee.io/sb.js",
},
{
source: "/_hive/:slug",
destination: "https://hive.splitbee.io/:slug",
},
];
},
});