-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
42 lines (42 loc) · 1.17 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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
experimental: {},
rewrites() {
const rewrites = require("./src/rewrites.json");
const rewritesArray = [];
Object.entries(rewrites.translations).forEach(([, translations]) => {
rewritesArray.push(
...rewrites.routes.map((route) => {
let source = route;
let destination = `/sl${route}`;
Object.entries(translations).forEach(([from, to]) => {
source = source.replace(`{${from}}`, to);
destination = destination.replace(`{${from}}`, from);
});
return {
source,
destination,
};
})
);
});
return rewritesArray;
},
images: {
remotePatterns: [
{
protocol: process.env.IMAGES_PROTOCOL,
hostname: process.env.IMAGES_HOSTNAME,
port: "",
pathname: `${process.env.IMAGES_PATHNAME}/**`,
},
],
},
};
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer(nextConfig);
module.exports = nextConfig;