Inlining scripts and styles in 11ty

1 · Hugo Giraudel · Dec. 3, 2020, 9:43 a.m.
I recently got Harry Robert’s course on CSS performance (you totally should to, it’s a goldmine of information) and worked on improving performance for this site. I quickly spotted 2 performance bottlenecks: requesting the stylesheet, and requesting the main script. I had about 4.7Kb of CSS, and less than 1Kb of JavaScript, so I figured the HTTP requests weren’t that necessary at all and I could inject styles and scripts directly within the page to avoid HTTP roundtrips. Inlining CSS and inlinin...