From 721d40b62b61440dc9e488787901c915579659db Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Thu, 14 Jul 2022 13:25:06 -0400 Subject: [PATCH] sad fix: regex "export default" out of CSS ssr --- packages/astro/src/core/render/dev/css.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/core/render/dev/css.ts b/packages/astro/src/core/render/dev/css.ts index 657289d36cbad..8310b58dd344d 100644 --- a/packages/astro/src/core/render/dev/css.ts +++ b/packages/astro/src/core/render/dev/css.ts @@ -70,8 +70,11 @@ export async function getStylesForURL( if ( mode === 'development' && // only inline in development typeof importedModule.ssrModule?.default === 'string' // ignore JS module styles - ) { - importedStylesMap.set(importedModule.url, importedModule.ssrModule.default); + ) { + const styles = importedModule.ssrModule?.default + .replace(/^export default "/, '') + .replace(/"$/, ''); + importedStylesMap.set(importedModule.url, styles); } else { // NOTE: We use the `url` property here. `id` would break Windows. importedCssUrls.add(importedModule.url);