forked from microsoft/opensource.microsoft.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
30 lines (25 loc) · 706 Bytes
/
next.config.ts
File metadata and controls
30 lines (25 loc) · 706 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
//
// Copyright (c) Microsoft.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
import type { NextConfig } from 'next';
const isProduction = process.env.NODE_ENV === 'production';
const nextConfig: NextConfig = isProduction ? {
output: 'export',
trailingSlash: true,
} : {};
if (!isProduction) {
nextConfig.rewrites = async function rewrites() {
return [
{
source: '/api/:path*',
destination: 'https://opensource.microsoft.com/api/:path*',
},
{
source: '/avatars/:path*',
destination: 'https://opensource.microsoft.com/avatars/:path*',
},
]
};
}
export default nextConfig;