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

[Bug][Vite plugin] Styles are incorrectly treeshaked in some cases when building #339

Open
RylanBueckert-Broadsign opened this issue Nov 5, 2024 · 0 comments

Comments

@RylanBueckert-Broadsign
Copy link

Some components styles are not present in when using vite build, but they are available when in dev mode (vite).

Example

If you use v-card-title without v-card in a project, when using dev mode, you can see there is a style applied to .v-card-title that includes font-size, padding, etc. This style is defined in vuetify/lib/components/VCard/VCard.css.

When building for production (vite build + vite preview), this style does not get included in the output and can visually see a difference in the padding of the component.

If a v-card is included in the project anywhere, the style is now loaded and v-card-title has its styles.

I know it may be considered strange or incorrect to use v-card-title without v-card, but I think the main issue here is that the result is not consistent for a build vs the dev mode. In this case I think the behavior should be that the VCard styles should be included if any of the related components are used. Other components may also be affected, but I am not sure.

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

No branches or pull requests

1 participant