fix(bankai): survive real-world CSS and serve real media types
ci / test (24) (push) Failing after 1m55s
ci / test (26) (push) Successful in 35s
ci / e2e (push) Failing after 1m8s

Lightning CSS refuses IE-era hacks (*zoom and friends) that established
libraries like tachyons still carry; enable errorRecovery so bankai
strips them instead of failing the build — a zero-config tool ingesting
decade-old CSS should shrug, not crash. Found migrating an actual choo
v7 production site. Also: proper MIME types for avif/jpg/gif/mp4/woff in
the static server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NgfSjHE11oFpoSnLVKLXd
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-08 20:03:09 +02:00
co-authored by Claude Fable 5
parent ce1ec9e4a9
commit af482330e9
3 changed files with 10 additions and 0 deletions
+3
View File
@@ -32,6 +32,9 @@ export default async function buildApp ({ entry, outDir = 'dist', title = 'choo'
appType: 'custom', appType: 'custom',
plugins: [bankaiPlugin(entry, { css })], plugins: [bankaiPlugin(entry, { css })],
logLevel: 'warn', logLevel: 'warn',
// real-world stylesheets (tachyons et al) carry IE-era hacks like
// *zoom; strip them instead of refusing to build
css: { lightningcss: { errorRecovery: true } },
build: { build: {
outDir, outDir,
emptyOutDir: true, emptyOutDir: true,
+1
View File
@@ -16,6 +16,7 @@ export default async function dev ({ entry, port = 8080, title = 'choo' }) {
appType: 'custom', appType: 'custom',
server: { middlewareMode: true }, server: { middlewareMode: true },
plugins: [bankaiPlugin(entry, { css })], plugins: [bankaiPlugin(entry, { css })],
css: { lightningcss: { errorRecovery: true } },
logLevel: 'warn' logLevel: 'warn'
}) })
+6
View File
@@ -31,8 +31,14 @@ const MIME = {
'.map': 'application/json', '.map': 'application/json',
'.txt': 'text/plain; charset=utf-8', '.txt': 'text/plain; charset=utf-8',
'.woff2': 'font/woff2', '.woff2': 'font/woff2',
'.woff': 'font/woff',
'.png': 'image/png', '.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.webp': 'image/webp', '.webp': 'image/webp',
'.avif': 'image/avif',
'.mp4': 'video/mp4',
'.ico': 'image/x-icon' '.ico': 'image/x-icon'
} }