Skip to content

Conversation

@askoufis
Copy link
Contributor

@askoufis askoufis commented Oct 1, 2024

Fixes #1481.

#1438 broke HMR invalidation for files that don't end in .css.ts, e.g. .css.tsx which is a valid, though uncommon, VE file extension.

This PR fixes this issue, as well as enables vite HMR for the features fixture to enable easier testing of HMR in the future.

@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2024

🦋 Changeset detected

Latest commit: de60b4c

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

This PR includes changesets to release 3 packages
Name Type
@vanilla-extract/vite-plugin Patch
@vanilla-extract-private/test-helpers Patch
@vanilla-extract-private/tests 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

Comment on lines -9 to -14
// Uncomment to enable HMR with Vite
// if (import.meta.hot) {
// import.meta.hot.accept('./features.css', () => {
// render();
// });
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't belong here anymore since this file no longer imports features.css.ts.

Comment on lines +14 to +18
// @ts-expect-error Vite env not defined
if (import.meta.hot) {
// @ts-expect-error Vite env not defined
import.meta.hot.accept();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Self-accepting is fine here.

@askoufis askoufis merged commit 30c0305 into master Oct 1, 2024
11 checks passed
@askoufis askoufis deleted the fix-hmr-invalidation branch October 1, 2024 04:25
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.

[VITE] - vite-plugin of vanilla-extract is not updating CSS style after saving.

2 participants