forked from Synthetixio/staking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
42 lines (36 loc) · 953 Bytes
/
next.config.js
File metadata and controls
42 lines (36 loc) · 953 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
40
41
42
// 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;
}, {});
module.exports = withPlugins([[optimizedImages]], {
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,
};
},
});