fix(build): temp fix until css bundler rewrite

This commit is contained in:
Julien Oculi 2025-04-22 16:54:57 +02:00
parent 987f58f50b
commit 50f77b06e3

View file

@ -8,7 +8,7 @@ app.use(staticFiles())
// temp fix before updating cssBundler middleware // temp fix before updating cssBundler middleware
app.use(async (ctx) => { app.use(async (ctx) => {
const response = await ctx.next() const response = await ctx.next()
if (response.status === 404) { if (response.status === 404 && !response.url.match(/\/chunk-\w+\.js.*/)) {
const ext = ctx.url.pathname.split('.').at(-1) ?? '.bin' const ext = ctx.url.pathname.split('.').at(-1) ?? '.bin'
const mime = contentType(ext) ?? 'application/octet-stream' const mime = contentType(ext) ?? 'application/octet-stream'
const file = await Deno.readFile(`./_fresh/static/${ctx.url.pathname}`) const file = await Deno.readFile(`./_fresh/static/${ctx.url.pathname}`)