Skip to content

?raw CSS is bundled in dev mode #6422

@nicholasray

Description

@nicholasray

What version of astro are you using?

2.0.17

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

CSS styles imported with ?raw are being bundled in dev mode. This seems to only happen in dev mode and appears to have started with Astro 2.0.7

To reproduce:

  1. Go to the codesandbox example
  2. Notice that import styleString from "./styles.css?raw" in index.astro leads to a red background.

Expected: The background is not red.
Actual: The background is red. Assets imported with ?raw should only be imported as strings.

Link to Minimal Reproducible Example

https://codesandbox.io/p/sandbox/rough-shape-l7t6qk?file=%2Fpackage.json&selection=%5B%7B%22endColumn%22%3A31%2C%22endLineNumber%22%3A10%2C%22startColumn%22%3A31%2C%22startLineNumber%22%3A10%7D%5D

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions