forked from docknetwork/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.es6.js
37 lines (33 loc) · 1019 Bytes
/
next.config.es6.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
import EthService from './components/eth/eth.service';
import optimizedImages from 'next-optimized-images';
import withPlugins from 'next-compose-plugins';
const config = {
exportPathMap: async function() {
const eth = EthService.getInstance();
await eth.init();
const transactions = await eth.votingCenter.allPolls();
const startIndex = transactions['0'].indexOf('0xf5c57613806020a478e68df7b1ea186ef9206087');
let pages = {};
for (let i = startIndex; i < transactions['0'].length; i++) {
const post = transactions['0'][i];
pages = Object.assign(pages, {
[`/proposal/${post}`]: {
page: '/proposal/[id]',
query: { id: post }
}
});
}
return Object.assign({}, pages, {
'/': { page: '/' },
'/network': { page: '/network' },
'/about': { page: '/about' },
'/governance': { page: '/governance' },
});
},
};
module.exports = withPlugins([
optimizedImages, {
inlineImageLimit: 256
}],
config,
);