- Dockerfile multi-etapa: build con Playwright (sitio, PDF, precompresión) y nginx sin privilegios en 8080 con healthcheck - nginx: CSP sin unsafe-inline, HSTS, nosniff, Referrer-Policy, caché inmutable para assets con hash, gzip_static, página 404 y /salud - scripts: verificar-prohibidas (falla con PLD, Odoo, lavado, CHM, 115/2026 en dist/), verificar-metricas (falla con resultado sin método), comprimir - Lighthouse CI con umbral 95 en móvil y presupuesto de 1.5 MB / 50 KB de JS - GitHub Actions: check, build, verificaciones, PDF, Lighthouse e imagen Docker Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
// Lighthouse CI: umbrales del BRIEF §9 en móvil sobre dist/.
|
|
// Presupuesto: ≤ 1.5 MB por página sin video y ≤ 50 KB de JS.
|
|
const paginas = ['/', '/proyectos/', '/proyectos/multisucursal/', '/proyectos/cotizador/', '/ingenieria/', '/firma/', '/contacto/', '/curriculum/'];
|
|
|
|
module.exports = {
|
|
ci: {
|
|
collect: {
|
|
staticDistDir: './dist',
|
|
url: paginas.map((p) => `http://localhost${p}`),
|
|
numberOfRuns: 1,
|
|
settings: {
|
|
formFactor: 'mobile',
|
|
screenEmulation: { mobile: true, width: 412, height: 823, deviceScaleFactor: 1.75, disabled: false },
|
|
onlyCategories: ['performance', 'accessibility', 'best-practices', 'seo'],
|
|
},
|
|
},
|
|
assert: {
|
|
assertions: {
|
|
'categories:performance': ['error', { minScore: 0.95 }],
|
|
'categories:accessibility': ['error', { minScore: 0.95 }],
|
|
'categories:best-practices': ['error', { minScore: 0.95 }],
|
|
'categories:seo': ['error', { minScore: 0.95 }],
|
|
'resource-summary:script:size': ['error', { maxNumericValue: 51200 }],
|
|
'resource-summary:total:size': ['error', { maxNumericValue: 1572864 }],
|
|
'errors-in-console': ['error', { maxLength: 0 }],
|
|
},
|
|
},
|
|
upload: { target: 'filesystem', outputDir: '.lighthouseci' },
|
|
},
|
|
};
|