Skip to content

Commit

Permalink
sad fix: regex "export default" out of CSS ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Jul 15, 2022
1 parent e67c194 commit 721d40b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/astro/src/core/render/dev/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 721d40b

Please sign in to comment.