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

css duplicate after build #6395

Closed
1 task
J-env opened this issue Mar 1, 2023 · 2 comments · Fixed by #6582
Closed
1 task

css duplicate after build #6395

J-env opened this issue Mar 1, 2023 · 2 comments · Fixed by #6582
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@J-env
Copy link

J-env commented Mar 1, 2023

What version of astro are you using?

2.0.16

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

None

What package manager are you using?

npm,pnpm

What operating system are you using?

Mac

Describe the Bug

  1. open link
    example

  2. npm run build

  3. View dist/index.html

image

  1. css content

image

I haven't found the reason yet.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-sdeict-ymlg1a?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@bluwy bluwy added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Mar 7, 2023
@bluwy bluwy self-assigned this Mar 9, 2023
@JerryWu1234
Copy link
Contributor

mark。
this bug looks fun

@bluwy
Copy link
Member

bluwy commented Mar 22, 2023

This seems to be similar #6524. What happens is that the CSS is imported in an Astro component and a framework component. When Astro does an SSR and client build, both builds would generate their own set of CSS artifacts which causes this duplication.

We do have code in place to remove the duplication though by matching CSS chunks from both builds and discarding one of them. I think #6582 might fix this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants