forked from nft3labs/isme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
66 lines (60 loc) · 1.34 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const path = require('path')
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
modularizeImports: {
lodash: {
transform: 'lodash/{{member}}',
},
},
},
compiler: {
styledComponents: true,
emotion: true,
},
eslint: {
dirs: ['app', 'domains', 'store', 'lib', 'pages', 'UI'],
},
webpack: (config, context) => {
const { buildId, dev, isServer, defaultLoaders, webpack } = context
// Important: return the modified config
const alias = config.resolve.alias
const emptyModule = path.resolve(__dirname, 'lib/ssr/empty-module.ts')
if (!isServer) {
alias.net = emptyModule
alias.child_process = emptyModule
alias.fs = emptyModule
}
// console.log(JSON.stringify(alias, null, 2))
config.plugins.push(
new webpack.DefinePlugin({
__SERVER__: isServer,
__DEV__: dev,
})
)
return config
},
async rewrites() {
return {
fallback: [],
}
},
async redirects() {
return [
{
source: '/:path*',
has: [
{
type: 'header',
key: 'host',
value: 'pass.nft3.com',
},
],
permanent: true,
destination: 'https://isme.is/:path*',
},
]
},
}
module.exports = nextConfig