* fix: optimize PageSpeed Insights performance This commit addresses several PageSpeed Insights issues to improve the performance score from 56 to a target of 90+. Changes: - Add SWC config to output modern ES2022 JavaScript, eliminating unnecessary polyfills (~12 KiB savings) - Convert vocalinux.png to WebP format (17KB vs 207KB - 92% reduction) - Add OptimizedImage component with WebP/PNG fallback support - Add _headers file for proper static asset caching (1 year cache for immutable assets) - Configure Next.js with optimizePackageImports for framer-motion and lucide-react - Fix heading hierarchy issue (Quick Install h3 -> h2) - Add console.log removal in production builds Expected improvements: - Image delivery: ~41 KiB savings - Legacy JavaScript: ~12 KiB savings - Cache lifetime: 754 KiB proper caching - Accessibility score: 98 -> 100 (heading order fix) * test: add coverage for PageSpeed optimization Add comprehensive test suite for PageSpeed Insights optimization changes: - WebP image loading tests (optimized-image.tsx) - next/image component configuration tests (next.config.js) - _headers file generation and cache header tests - Lazy loading behavior tests Includes: - Jest configuration with TypeScript support - React Testing Library setup - 54 test cases covering all PageSpeed optimization features - Build verification All tests pass: npm run test Build passes: npm run build * ci: trigger workflow * ci: trigger workflow run * ci: trigger workflow
28 lines
510 B
Plaintext
28 lines
510 B
Plaintext
{
|
|
"$schema": "https://json.schemastore.org/swcrc",
|
|
"jsc": {
|
|
"target": "es2022",
|
|
"parser": {
|
|
"syntax": "typescript",
|
|
"tsx": true,
|
|
"decorators": true,
|
|
"dynamicImport": true
|
|
},
|
|
"transform": {
|
|
"react": {
|
|
"runtime": "automatic"
|
|
}
|
|
},
|
|
"loose": false,
|
|
"externalHelpers": false
|
|
},
|
|
"minify": true,
|
|
"sourceMaps": true,
|
|
"env": {
|
|
"targets": {
|
|
"browsers": [">0.5%", "not dead", "not op_mini all"]
|
|
},
|
|
"coreJs": false
|
|
}
|
|
}
|