-
Notifications
You must be signed in to change notification settings - Fork 20
/
next.config.js
59 lines (57 loc) · 1.92 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
// @ts-check
import withPlaiceholder from "@plaiceholder/next";
/**
* @type {import('next').NextConfig}
*/
const config = {
reactStrictMode: true,
images: {
domains: ['localhost', 'api.testausserveri.fi', 'avatars.githubusercontent.com', 'testausauto.fi'],
},
async rewrites() {
return [
{
source: '/api/v1/:path*',
destination: process.env.NEXT_PUBLIC_API_SERVER + '/v1/:path*',
},
]
},
i18n: {
locales: ['fi'],
defaultLocale: 'fi',
},
compiler: {
styledComponents: true
},
async redirects() {
return [
{ "source": "/.well-known/webfinger", "destination": "https://mastodon.testausserveri.fi/.well-known/webfinger", permanent: true },
{ "source": "/github", "destination": "https://api.testausserveri.fi/v1/github/authorize", permanent: true },
{ "source": "/jasenhakemus", "destination": "/apply", permanent: false },
{ "source": "/host/enable", "destination": "https://forms.gle/Z9oTUEKAdHheBcVT6", permanent: false },
{ "source": "/link/jasenhakemus", "destination": "/apply", permanent: false },
{ "source": "/link/:path*", "destination": "https://link.testausserveri.fi/:path*", permanent: true },
{ "source": "/yhdistyksen-saannot.pdf", "destination": "/association-rules", permanent: true },
{ "source": "/host/privacy", "destination": "/privacy/host", permanent: true }
];
},
webpack: (config, options) => {
config.module.rules.push({
test: /\.mdx$/, use: 'raw-loader'
})
const prefix = config.assetPrefix ?? config.basePath ?? '';
config.module.rules.push({
test: /\.(mp4|splinecode)$/,
use: [{
loader: 'file-loader',
options: {
publicPath: `${prefix}/_next/static/media/`,
outputPath: `${config.isServer ? '../' : ''}static/media/`,
name: '[name].[hash:8].[ext]',
},
}],
});
return config
}
};
export default withPlaiceholder(config);