Closed VIKTORVAV99 closed 1 week ago
If we want to save a few kB on the css bundle we can also switch to https://lightningcss.dev as the minifier (it's as simple as adding the dependency and changing a single config option). There is no build cost to this, it's actually faster by 3-4x, but there would be another dependency to install.
Issue
Since we didn't import the CSS in the same place as the other CSS files it created a separate bundle at build time. And since CSS is render blocking both where needed for the map to render.
Description
Moves the CSS import to our
main.tsx
where our other CSS imports are so they end up in the same bundle.Initial testing shows some improvement in Lighthouse / PageSpeed Insights but the margins are not big enough to draw any significant conclusions.
Should also resolve: https://electricitymaps.sentry.io/issues/5029660668/?project=4504366922989568
Preview
On master:
On this branch:
Double check
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.