Skip to content

Commit

Permalink
fix(hmr): don't try to rewrite imports for direct CSS soft invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 2, 2024
1 parent 78e749e commit cb40cb5
Showing 1 changed file with 3 additions and 2 deletions.
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') {
result = transformResult
}
// We need to transform each imports with new timestamps if available
Expand Down

0 comments on commit cb40cb5

Please sign in to comment.