-
Notifications
You must be signed in to change notification settings - Fork 252
Expand file tree
/
Copy pathnext.config.ts
More file actions
31 lines (29 loc) · 919 Bytes
/
next.config.ts
File metadata and controls
31 lines (29 loc) · 919 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
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Otimiza imports de bibliotecas com barrel files (index.js que re-exporta tudo)
// Isso evita carregar módulos não utilizados, reduzindo o bundle em 15-25KB
// Ref: https://vercel.com/blog/how-we-optimized-package-imports-in-next-js
experimental: {
optimizePackageImports: [
'lucide-react', // 1500+ ícones, carrega só os usados
'recharts', // Biblioteca de gráficos pesada
'date-fns', // Utilitários de data
'@radix-ui/react-icons',
],
},
turbopack: {
root: process.cwd(),
},
async headers() {
return [
{
source: "/sw.js",
headers: [
{ key: "Cache-Control", value: "no-cache" },
{ key: "Content-Type", value: "application/javascript; charset=utf-8" },
],
},
];
},
};
export default nextConfig;