- CSS delle pagine incluso nell'HTML: nessun foglio di stile bloccante (Lighthouse mobile: Performance 0.99–1, Accessibility, Best Practices e SEO 1) - token --gold-800 per il testo delle chip (contrasto 4.98:1) - lighthouserc: soglie di §9.3 bloccanti, audit informativi declassati ad avviso - verificati titoli (≤ 65 caratteri) e descrizioni (120–155) unici, nessun overflow orizzontale a 320 px Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
48 lines
1.8 KiB
JavaScript
48 lines
1.8 KiB
JavaScript
// Lighthouse CI — budget di §9.3 del brief (preset mobile di Lighthouse, 3 run, mediana).
|
|
// Chrome: si usa il Chromium installato da Playwright, così funziona anche nel container CI.
|
|
const { chromium } = require('playwright');
|
|
|
|
module.exports = {
|
|
ci: {
|
|
collect: {
|
|
staticDistDir: './dist',
|
|
url: [
|
|
'http://localhost/',
|
|
'http://localhost/servizi/',
|
|
'http://localhost/servizi/consulenza-fiscale-tributaria-e-societaria/',
|
|
'http://localhost/contatti/',
|
|
],
|
|
numberOfRuns: 3,
|
|
chromePath: chromium.executablePath(),
|
|
settings: {
|
|
chromeFlags: '--no-sandbox --headless=new --disable-dev-shm-usage --disable-gpu',
|
|
},
|
|
},
|
|
assert: {
|
|
preset: 'lighthouse:recommended',
|
|
aggregationMethod: 'median-run',
|
|
assertions: {
|
|
// Soglie del brief §9.3: sono queste a bloccare la CI.
|
|
'categories:performance': ['error', { minScore: 0.95 }],
|
|
'categories:accessibility': ['error', { minScore: 1 }],
|
|
'categories:best-practices': ['error', { minScore: 0.95 }],
|
|
'categories:seo': ['error', { minScore: 1 }],
|
|
// Audit informativi o dipendenti dal server di test, declassati ad avviso
|
|
// (vedi DECISIONS.md). Restano visibili nei report.
|
|
'network-dependency-tree-insight': 'warn', // segnala qualsiasi catena HTML → font/JS
|
|
'critical-request-chains': 'warn',
|
|
'render-blocking-insight': 'warn',
|
|
'render-blocking-resources': 'warn',
|
|
'uses-http2': 'warn', // il server statico di LHCI usa HTTP/1.1
|
|
'bf-cache': 'warn',
|
|
'csp-xss': 'warn', // la CSP è un header del server (.htaccess), assente in LHCI
|
|
},
|
|
},
|
|
upload: {
|
|
// Nessun invio a servizi esterni: i report restano in locale.
|
|
target: 'filesystem',
|
|
outputDir: '.lighthouseci/reports',
|
|
},
|
|
},
|
|
};
|