fix(bankai): survive real-world CSS and serve real media types
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:
co-authored by
Claude Fable 5
parent
ce1ec9e4a9
commit
af482330e9
@@ -32,6 +32,9 @@ export default async function buildApp ({ entry, outDir = 'dist', title = 'choo'
|
||||
appType: 'custom',
|
||||
plugins: [bankaiPlugin(entry, { css })],
|
||||
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: {
|
||||
outDir,
|
||||
emptyOutDir: true,
|
||||
|
||||
@@ -16,6 +16,7 @@ export default async function dev ({ entry, port = 8080, title = 'choo' }) {
|
||||
appType: 'custom',
|
||||
server: { middlewareMode: true },
|
||||
plugins: [bankaiPlugin(entry, { css })],
|
||||
css: { lightningcss: { errorRecovery: true } },
|
||||
logLevel: 'warn'
|
||||
})
|
||||
|
||||
|
||||
@@ -31,8 +31,14 @@ const MIME = {
|
||||
'.map': 'application/json',
|
||||
'.txt': 'text/plain; charset=utf-8',
|
||||
'.woff2': 'font/woff2',
|
||||
'.woff': 'font/woff',
|
||||
'.png': 'image/png',
|
||||
'.jpg': 'image/jpeg',
|
||||
'.jpeg': 'image/jpeg',
|
||||
'.gif': 'image/gif',
|
||||
'.webp': 'image/webp',
|
||||
'.avif': 'image/avif',
|
||||
'.mp4': 'video/mp4',
|
||||
'.ico': 'image/x-icon'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user