-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
50 lines (43 loc) · 1.12 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
// next.config.js
const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');
// all the dynamic pages need to be defined here (this needs to be imported from the routes)
const stakingPages = ['/staking', '/staking/burn', '/staking/mint'].reduce((pages, page) => {
pages[page] = {
page: '/staking/[[...action]]',
};
return pages;
}, {});
const earnPages = [
'/earn',
'/earn/claim',
'/earn/curve-LP',
'/earn/iBTC-LP',
'/earn/iETH-LP',
].reduce((pages, page) => {
pages[page] = {
page: '/earn/[[...pool]]',
};
return pages;
}, {});
const poolPages = ['/pools/weth-snx'].reduce((pages, page) => {
pages[page] = {
page: '/pools/[[...pool]]',
};
return pages;
}, {});
module.exports = withPlugins([[optimizedImages, { images: { optimize: false } }]], {
webpack: (config) => {
config.resolve.mainFields = ['module', 'browser', 'main'];
return config;
},
trailingSlash: !!process.env.NEXT_PUBLIC_TRAILING_SLASH_ENABLED,
exportPathMap: function (defaultPathMap) {
return {
...defaultPathMap,
...stakingPages,
...earnPages,
...poolPages,
};
},
});