-
Notifications
You must be signed in to change notification settings - Fork 24
/
next.config.js
71 lines (63 loc) · 1.71 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
67
68
69
70
71
const path = require('path');
const svgSprite = require('./plugins/next-svg-sprites');
const cssLoaderConfig = require('./plugins/css-loader-config');
const { i18n } = require('./next-i18next.config');
module.exports = (phase, { defaultConfig }) => {
const plugins = [svgSprite, cssLoaderConfig];
const transformers = [];
const nextConfig = plugins.reduce(
(acc, next) => {
const nextConfig = next(acc);
if (typeof nextConfig.webpack === 'function') {
transformers.push(nextConfig.webpack);
}
return nextConfig;
},
{
swcMinify: true,
reactStrictMode: true,
images: {
domains: [
'i.imgur.com',
'sputnik-dao.s3.eu-central-1.amazonaws.com',
'ipfs.io',
'ipfs.fleek.co',
'cloudflare-ipfs.com',
],
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
async rewrites() {
return [
{
source: '/create-dao',
destination: '/create-dao/foundation',
},
];
},
/* experimental: {
outputStandalone: true,
},*/
i18n,
publicRuntimeConfig: {
shouldUseExternalAssetUrl: process.env.NODE_ENV === 'production',
assetUrl: '/_next/static/sprite.svg',
},
}
);
nextConfig.webpack = (config, options) => {
config.externals = [...config.externals, 'bufferutil', 'utf-8-validate'];
config.resolve.fallback = {
fs: false,
tls: false,
net: false,
https: false,
http: false,
crypto: false,
os: false,
};
return transformers.reduce((acc, next) => next(acc, options), config);
};
return nextConfig;
};