Skip to content

Labs build warning fixes and optimisations#403

Draft
codingfrog27 wants to merge 5 commits intomainfrom
css-selection-fix
Draft

Labs build warning fixes and optimisations#403
codingfrog27 wants to merge 5 commits intomainfrom
css-selection-fix

Conversation

@codingfrog27
Copy link
Copy Markdown
Contributor

@codingfrog27 codingfrog27 commented Apr 29, 2026

Build fixes:

A multitude of small build optimisations and warning fixes/silencing.

  • Tailwind pattern: adjusted tailwind content scan pattern (halves build time)
  • Failed to resolve font file warning put the font in an inline style block to prevent vite from pre resolving it and adding /docs to the path, causing it to fail.
    • Also removed the bracketed name file extention in the name for the font file as we seem to only use woff2 and it could cause issues.
  • Chunk size warning: Vite warns for a couple of chunks that are larger than 500kb.. I looked into some options to make these smaller but the large chunks were mostly demos. Opted to increase the warning size to 700 kb instead. (Can see the argument that the warning is better to keep.. Some demos do still pass over 700kb anyways. I'd say 500 is acceptable but more than 700 is worth seeing, hence this number)
  • npm unkown env config warning: The warning was caused by us running npx pagefind, I replaced it with a local binary (Which should work on both Unix and windows). This did feel a bit off but from what I've read it's standard practice? Feedback welcome.
  • Added HTML wrapper for index.astro: Pagefind gave a warning pages were missing the html element, fix should also help with SEO optimisation.

What to test

  • using the search bar on windows machines
  • Deeper testing that no UI elements got removed with the adjustment of the tailwind pattern. So far I've only checked Browserpod docs.

Future fixes

  • Centralize the font into a dedicated asset for caching optimisation (Either by putting it in theme/root head or via @font-face)
  • Look into if we can lazy load the demos causing the large chunks

For Merging!!

Since these are a lot of technical changes I think we shouldn't squash it all into 1 commit Ive cleaned up my commit history to have one fix per commit. So please rebase onto main rather than the usual squash and merge. :)

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 30, 2026

Deploying labs-browserpod-previews with  Cloudflare Pages  Cloudflare Pages

Latest commit: 89f79f8
Status: ✅  Deploy successful!
Preview URL: https://1e61f874.labs-browserpod-previews.pages.dev
Branch Preview URL: https://css-selection-fix.labs-browserpod-previews.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant