forked from 8by8-org/8by8-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
50 lines (46 loc) · 1.17 KB
/
next.config.mjs
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
import { createCSP } from './scripts/create-content-security-policy.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
/*
Cache images and other static assets for one year. This prevents a
flickering effect that can occur when client components load, among
other benefits.
*/
async headers() {
return [
{
source: '/:all*(svg|jpg|jpeg|png|gif|ico|webp|mp4|ttf|otf|woff|woff2)',
headers: [
{
key: 'cache-control',
value: 'public, max-age=31536000, immutable',
},
],
},
{
source: '/(.*)',
headers: [createCSP()],
},
];
},
async redirects() {
return [
{
source: '/register',
destination: '/register/eligibility',
permanent: true,
},
{
/*
The Wix site (https://8by8.us) contains a link to /homepage, which
doesn't exist in the new 8by8 challenge application. Redirect to
/ for now until the Wix site can be updated.
*/
source: '/homepage',
destination: '/',
permanent: true,
},
];
},
};
export default nextConfig;