-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
39 lines (37 loc) · 909 Bytes
/
next.config.js
File metadata and controls
39 lines (37 loc) · 909 Bytes
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
// next.config.js
const path = require('path')
/** @type {import('next').NextConfig} */
const nextConfig = {
// Your config here
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**medium.com',
port: '',
},
],
},
webpack: (config) => {
// This fixes the invalid hook React error which
// will occur when multiple versions of React is detected
// This can happen since common project is also using Next (which is using React)
const reactPaths = {
react: path.join(__dirname, 'node_modules/react'),
'react-dom': path.join(__dirname, 'node_modules/react-dom'),
}
config.resolve = {
...config.resolve,
alias: {
...config.resolve.alias,
...reactPaths,
},
}
return config
},
experimental: {
appDir: true,
},
}
module.exports = nextConfig