forked from near-daos/astro-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
52 lines (47 loc) · 1.32 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
const path = require('path');
const svgSprite = require('./plugins/next-svg-sprites');
const cssLoaderConfig = require('./plugins/css-loader-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;
},
{
...defaultConfig,
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: '/api-server/:path*',
destination: process.env.NEXT_PUBLIC_API_URL + '/api/:path*' // Proxy to Backend
},
{
source: '/create-dao',
destination: '/create-dao/foundation'
}
];
}
}
);
nextConfig.webpack = (config, options) =>
transformers.reduce((acc, next) => next(acc, options), config);
return nextConfig;
};