Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
115 lines (112 loc) · 2.97 KB
/
Copy pathnext.config.js
File metadata and controls
115 lines (112 loc) · 2.97 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/** @type {import('next').NextConfig} */
const isTauri = process.env.TAURI_BUILD === 'true';
const nextConfig = {
// Disabilita Next.js Dev Tools indicator
devIndicators: false,
// Permetti richieste cross-origin da Tauri in dev
allowedDevOrigins: ['127.0.0.1', 'localhost', 'tauri.localhost'],
// Static export for Tauri production build
...(isTauri && {
output: 'export',
trailingSlash: true,
distDir: 'out',
}),
eslint: {
// Errori ESLint azzerati il 2026-06-11 — la build ora blocca sugli errori
// (i warning non bloccano; il lint gira anche in CI come gate bloccante)
ignoreDuringBuilds: false,
},
typescript: {
// Errori TS azzerati il 2026-06-11 — il build ora blocca su errori di tipo
// (tsc --noEmit gira anche in CI come gate bloccante)
ignoreBuildErrors: false,
},
// Bundle size optimizations
compiler: {
// Rimuovi console.log in produzione
removeConsole: process.env.NODE_ENV === 'production' ? {
exclude: ['error', 'warn'],
} : false,
},
experimental: {
// Ottimizza pacchetti grandi — tree-shaking automatico
optimizePackageImports: [
'lucide-react',
'date-fns',
'radix-ui',
'framer-motion',
'cmdk',
'recharts',
'class-variance-authority',
],
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'steamcdn-a.akamaihd.net',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn.akamai.steamstatic.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'shared.akamai.steamstatic.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn.steamgriddb.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn2.steamgriddb.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'media.steampowered.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn.cloudflare.steamstatic.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'store.steampowered.com',
port: '',
pathname: '/**',
},
],
},
// Turbopack config (equivalente del webpack externals per winreg)
turbopack: {
resolveAlias: {
winreg: { browser: './lib/winreg-stub.js' },
},
},
webpack: (config, { isServer }) => {
// Risolve l'errore 'Module not found: Can't resolve 'winreg''
// Marcando 'winreg' come modulo esterno, diciamo a Webpack di non provare a includerlo nel bundle.
// Questo è necessario per i pacchetti nativi di Node.js che non sono destinati al browser.
if (isServer) {
config.externals.push('winreg');
}
return config;
},
};
module.exports = nextConfig;