Skip to content

Commit

Permalink
Revert "sad fix: regex "export default" out of CSS ssr"
Browse files Browse the repository at this point in the history
This reverts commit 721d40b.
  • Loading branch information
bholmesdev committed Jul 15, 2022
1 parent 7f13e12 commit 7b60b8c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/astro/src/core/render/dev/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,8 @@ export async function getStylesForURL(
if (
mode === 'development' && // only inline in development
typeof importedModule.ssrModule?.default === 'string' // ignore JS module styles
) {
// TODO: understand where this export default wrapper is coming from
// Note: does not occur when SSR-ing styles in plain Vite 3
const styles = importedModule.ssrModule?.default
.replace(/^export default "/, '')
.replace(/"$/, '');
importedStylesMap.set(importedModule.url, styles);
) {
importedStylesMap.set(importedModule.url, importedModule.ssrModule.default);
} else {
// NOTE: We use the `url` property here. `id` would break Windows.
importedCssUrls.add(importedModule.url);
Expand Down

0 comments on commit 7b60b8c

Please sign in to comment.