-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
30 lines (23 loc) · 788 Bytes
/
next.config.ts
File metadata and controls
30 lines (23 loc) · 788 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
import type { RemotePattern } from 'next/dist/shared/lib/image-config';
import type { StaticNextConfig } from './src/types/next-config';
import { withMiddlewareAggregator } from './src/modules/middleware-aggregator';
const getImageRemotePatterns = (): RemotePattern[] => {
const nextPublicServerUrl = new URL('/', process.env.NEXT_PUBLIC_SERVER_URL);
const { protocol: protocolWithColon, hostname, port } = nextPublicServerUrl;
return [
{
protocol: protocolWithColon.replace(':', '') as RemotePattern['protocol'],
hostname,
port,
},
];
};
const nextConfig: StaticNextConfig = {
images: {
remotePatterns: getImageRemotePatterns(),
},
typescript: {
ignoreBuildErrors: true,
},
};
export default withMiddlewareAggregator(nextConfig);