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

Remove duplicate CSS in dev #5917

Merged
merged 2 commits into from
Jan 23, 2023
Merged

Remove duplicate CSS in dev #5917

merged 2 commits into from
Jan 23, 2023

Conversation

natemoo-re
Copy link
Member

Changes

Testing

  • E2E test added for default handling
  • E2E test added to confirm this also works when vite.css.devSourcemap is enabled

Docs

Bug fix only

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2023

🦋 Changeset detected

Latest commit: 07bc93a

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

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

⚖️ Bundle Size Check

Latest commit: 07bc93a

File Old Size New Size Change
hmr 712 B 802 B + 90 B

@@ -133,7 +133,11 @@ async function getScriptsAndStyles({ env, filePath }: GetScriptsAndStylesParams)
});
// But we still want to inject the styles to avoid FOUC
styles.add({
props: {},
props: {
type: 'text/css',
Copy link
Contributor

Choose a reason for hiding this comment

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

is this because vite needs the attributes to match? if not, type is not need on script or style, <style> is always text/css.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, data-astro-dev-id is the only necessary change here. I just added this for consistency with the styles Vite injects.

@natemoo-re natemoo-re merged commit 7325df4 into main Jan 23, 2023
@natemoo-re natemoo-re deleted the fix/5817 branch January 23, 2023 18:03
matthewp pushed a commit that referenced this pull request Jan 26, 2023
* fix(#5817): remove duplicate CSS in dev

* chore: add changeset

Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS Sourcemap Duplication of References in Dev
2 participants