-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
34 lines (27 loc) · 871 Bytes
/
next.config.ts
File metadata and controls
34 lines (27 loc) · 871 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
31
32
33
34
import { NextConfig } from 'next';
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '';
// Função para parsear domains de variável de ambiente
const getRemotePatterns = () => {
const patterns: any[] = [];
// Adicionar domains extras via env (separados por vírgula)
// Ex: NEXT_PUBLIC_ALLOWED_DOMAINS=example.com,cdn.example.com
const extraDomains = process.env.NEXT_PUBLIC_ALLOWED_DOMAINS?.split(',') || [];
extraDomains.forEach((domain) => {
const trimmedDomain = domain.trim();
if (trimmedDomain) {
patterns.push({
protocol: 'https' as const,
hostname: trimmedDomain,
});
}
});
return patterns;
};
const nextConfig: NextConfig = {
output: 'standalone',
basePath: basePath,
images: {
remotePatterns: getRemotePatterns(),
},
};
export default nextConfig;