-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
43 lines (38 loc) · 1.15 KB
/
next.config.js
File metadata and controls
43 lines (38 loc) · 1.15 KB
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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNextIntl = require("next-intl/plugin")();
/** @type {import('next').NextConfig} */
const nextConfig = withNextIntl({
webpack(config, context) {
// https://react-svgr.com/docs/next/#usage
config.module.rules.push({
test: /\.svg$/i,
use: ["@svgr/webpack"],
});
// https://github.com/mswjs/msw/issues/1801
if (context.isServer) {
// next server build => ignore msw/browser
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/browser", alias: false });
} else {
config.resolve.alias["msw/browser"] = false;
}
} else {
// browser => ignore msw/node
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/node", alias: false });
} else {
config.resolve.alias["msw/node"] = false;
}
}
return config;
},
// async rewrites() {
// return [
// {
// source: "/api/:path*",
// destination: `${process.env.NEXT_PUBLIC_API_URL}/api/:path*`,
// },
// ];
// },
});
module.exports = nextConfig;