From eff591b427c08b9c3ced7dfacd31196dc4a94ffe Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Mon, 5 Feb 2024 15:45:00 +0100 Subject: [PATCH] fix: prevent reading non existing file --- plugins/css_bundler/src/middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/css_bundler/src/middleware.ts b/plugins/css_bundler/src/middleware.ts index 8065dc3..d78fd44 100644 --- a/plugins/css_bundler/src/middleware.ts +++ b/plugins/css_bundler/src/middleware.ts @@ -12,7 +12,7 @@ export function cssHandler(sourceDir: string): MiddlewareHandler { if ( ctx.url.pathname.startsWith('/') && ctx.url.pathname.endsWith('.css') ) { - bundleCss(sourceDir, assetDir, ctx.url.pathname, ctx.config.dev) + await bundleCss(sourceDir, assetDir, ctx.url.pathname, ctx.config.dev) const file = await Deno.readFile(join(assetDir, ctx.url.pathname)) return new Response(file, { headers: {