-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
115 lines (111 loc) · 3.35 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const withPlugins = require('next-compose-plugins');
const OptimizedImages = require('next-optimized-images');
const withVideos = require('next-videos')
const customConfig = {
devIndicators: { autoPrerender: false },
webpack5: false,
target: 'serverless',
webpack: function (config) {
config.module.rules.push(
{
test: /\.ya?ml$/,
use: 'js-yaml-loader',
},
)
return config
},
webpackDevMiddleware: config => {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
return config
},
generateInDevMode: false,
workboxOpts: {
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 5000000,
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg)$/,
handler: 'CacheFirst',
options: {
cacheName: 'images',
expiration: {
maxEntries: 10,
},
},
},
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'offlineCache',
expiration: {
maxEntries: 200,
},
},
},
],
},
async redirects() {
return [
{
source: '/hall-of-fame',
destination: '/stats',
permanent: true,
},
{
source: '/rankings',
destination: '/stats',
permanent: false,
},
{
source: '/rankings',
destination: '/stats',
permanent: false,
}
]
},
exportPathMap: async function(
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
const posts = require('./src/data/posts');
const writeups = require('./src/data/writeups');
return {
"/": { page: "/" },
"/blog": { page: "/blog" },
"/about": { page: "/about" },
"/stats": { page: "/stats" },
"/faq": { page: "/faq" },
"/rules": { page: "/rules" },
"/branding": { page: "/branding" },
"/promote": { page: "/promote" },
"/publicize": { page: "/publicize" },
"/ssi": { page: "/ssi" },
"/start": { page: "/start" },
"/resources": { page: "/resources" },
"/trainings": { page: "/trainings" },
"/advisory-board": { page: "/advisory-board" },
"/discord": { page: "/discord" },
"/join": { page: "/join" },
"/join1": { page: "/join1" },
"/join2": { page: "/join2" },
"/privacy": { page: "/privacy" },
"/sponsors": { page: "/sponsors" },
"/organizers": { page: "/organizers" },
"/championship": { page: "/championship" },
"/talent-incubation": { page: "/talent-incubation" },
...writeups,
...posts
}
},
env: {
domain: 'https://play.inctf.in/junior',
}
};
module.exports = withPlugins([
[withVideos],
[OptimizedImages],
], customConfig);