Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent including module metadata imports for side-effectual CSS #410

Merged
merged 4 commits into from
May 24, 2022

Conversation

matthewp
Copy link
Contributor

Changes

  • The compiler adds import statements for each user import in order to figure out which one maps to a component.
  • CSS side-effectual imports should not be included in this metadata. Doing so prevents CSS try shaking this code away.
  • This is part of switching to Vite's internal CSS plugin and fixing 🐛 BUG: css url() replaced by __VITE_ASSET__* astro#2146

Testing

  • Test added

Docs

N/A, bug fix.

@changeset-bot
Copy link

changeset-bot bot commented May 24, 2022

🦋 Changeset detected

Latest commit: c24867a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/compiler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I would just make sure we're matching core in terms of what constitutes a CSS import

internal/printer/printer.go Outdated Show resolved Hide resolved
@matthewp matthewp merged commit 26cbcdb into main May 24, 2022
@matthewp matthewp deleted the css-import branch May 24, 2022 20:21
natemoo-re pushed a commit that referenced this pull request Jul 20, 2022
* Prevent including module metadata imports for side-effectual CSS

* Adds a changeset

* Change escaping for lint

* Update expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants