Skip to content

Commit de91192

Browse files
committed
Prevent ?raw CSS imports from being added as styles in dev
1 parent 8897c3e commit de91192

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • packages/astro/src/vite-plugin-css

packages/astro/src/vite-plugin-css/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ function* collectCSSWithOrder(
5353
};
5454
return;
5555
}
56+
// ?raw imports the underlying css but is handled as a string in the JS.
57+
else if(id.endsWith('?raw')) {
58+
return;
59+
}
5660

5761
// Recursively walk imported modules (depth-first)
5862
for (const imp of imported) {

0 commit comments

Comments
 (0)