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

fix(hmr): don't try to rewrite imports for direct CSS soft invalidation #18252

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(hmr): don't try to rewrite imports for direct CSS soft invalidation
  • Loading branch information
sapphi-red committed Oct 2, 2024
commit cb40cb55525e2051ac4f6e341511ce4bb23e4bfe
5 changes: 3 additions & 2 deletions packages/vite/src/node/server/transformRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ async function handleModuleSoftInvalidation(
}

let result: TransformResult
// For SSR soft-invalidation, no transformation is needed
if (transformResult.ssr) {
// For SSR or direct CSS, no transformation is needed
// Note that direct CSS soft invalidation happens when files included by tailwind's `content` option is updated
if (transformResult.ssr || mod.type === 'css') {
bluwy marked this conversation as resolved.
Show resolved Hide resolved
result = transformResult
}
// We need to transform each imports with new timestamps if available
Expand Down