‹ BackHN Continuity

Thread

Improving site performance by shipping more CSS

96 points · 72 comments · torutofu

  1. efortis · · focus · HN ↗
    There's room for improvement still. Currently, the production build is using long-dev class names. e.g. `DirectoryContent-module__Box_3__gl6dE` could be compiled to a shorter hash like `gl6DE3a2`.

    If you use Vite:

      css: {
        modules: {
          generateScopedName: mode === 'production'
            ? '[hash:base64:8]'
            : '[name]__[local]___[hash:base64:5]',
          }
        }
    1. Starlevel004 · · focus · HN ↗
      Perhaps we should never ever use hashed class names?
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.