-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
48 lines (45 loc) · 1.42 KB
/
next.config.js
File metadata and controls
48 lines (45 loc) · 1.42 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
44
45
46
47
48
/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-require-imports
const path = require("path");
const reactPath = path.resolve(__dirname, "node_modules/react");
const reactDomPath = path.resolve(__dirname, "node_modules/react-dom");
const nextConfig = {
i18n: {
locales: ["en"],
defaultLocale: "en",
},
async headers() {
return [
{
source: "/:path*",
headers: [
{ key: "Access-Control-Allow-Origin", value: "*" },
{
key: "Access-Control-Allow-Headers",
value:
"Origin, X-Requested-With, Content-Type, Accept, Authorization",
},
],
},
];
},
// Turbopack (default in `next dev` since Next 15) ignores the `webpack`
// option below, so we have to dedupe React for it explicitly. Without this,
// any locally-linked dependency (e.g. `link:` to react-split-flap-display)
// pulls in its own copy of React from its own node_modules and you get
// "Cannot read properties of null (reading 'useRef')" at runtime.
turbopack: {
resolveAlias: {
react: reactPath,
"react-dom": reactDomPath,
},
},
webpack: (config) => {
config.resolve.alias["react"] = reactPath;
config.resolve.alias["react-dom"] = reactDomPath;
return config;
},
reactStrictMode: true,
};
module.exports = nextConfig;