Skip to content

SEO/CWV: minify:false ships a 1.5 MB unminified chunk; render-blocking jsdelivr CSS; no preconnect hints #259

Description

@limonte

Problem

Core Web Vitals are a ranking signal, and several build/loading choices work against them.

1. Minification is disabled

vite.config.js

build: {
  minify: false,
  ...
}

Result:

$ du -h dist/assets/components-*.js
1.5M  dist/assets/components-8DxwRGCF.js
$ du -sh dist/assets
3.5M  dist/assets

A 1.5 MB unminified main chunk. Since the site is also CSR-only, nothing renders until that chunk is downloaded, parsed, and executed — so this directly gates LCP, and it makes each Googlebot render pass expensive (which matters for render-budget scheduling).

If minify: false is intentional so people can read the source, source maps are the better tool — they give readable sources on demand without shipping 1.5 MB to every visitor.

2. Two render-blocking third-party stylesheets

partials/head.html

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@4/animate.min.css" />

Both are render-blocking and both require a fresh DNS + TLS handshake to cdn.jsdelivr.net before the page can paint. Additionally:

  • font-awesome 4 is end-of-life (last release 2016) and pulls a full icon webfont for a handful of icons (fa-bars, fa-arrow-left). Inline SVGs would drop the font entirely.
  • animate.css is loaded on every page for the sidebar's fadeInLeft/fadeOutLeft. Two keyframes worth of CSS could be copied into styles/styles.scss.

Self-hosting or eliminating both removes a third-party origin from the critical path.

3. No resource hints

No preconnect/dns-prefetch for any third-party origin: cdn.jsdelivr.net, Algolia (*.algolia.net / *.algolianet.com for DocSearch), analytics.limonte.dev, ghbtns.com, api.github.com, api.npmjs.org. The Header.tsx stats block fires three cross-origin fetch calls on mount with no hint at all.

At minimum:

<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
<link rel="preconnect" href="https://XXXXXXX-dsn.algolia.net" crossorigin />

4. Sandpack on every recipe page

@codesandbox/sandpack-react is bundled into all 21 recipe pages and is the dominant cost there. Worth deferring until the editor scrolls into view (or until interaction), with a static <pre><code> block rendered first — which also gives those pages crawlable content (see the thin-content issue).

Suggested fix

In priority order:

  1. Turn minification back on (minify: 'esbuild' or default) and ship source maps instead.
  2. Drop font-awesome for inline SVG icons; inline the two animate.css keyframes.
  3. Add preconnect hints for whatever third-party origins remain.
  4. Lazy-mount Sandpack.

Measure before/after with PageSpeed Insights on / and one recipe page.

Impact

Medium-high — item 1 alone is a one-line change with a large effect on LCP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions