We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d90ba40 commit 74a79c5Copy full SHA for 74a79c5
packages/vite/src/node/server/middlewares/transform.ts
@@ -52,7 +52,10 @@ export function cachedTransformMiddleware(
52
const ifNoneMatch = req.headers['if-none-match']
53
if (ifNoneMatch) {
54
const moduleByEtag = server.moduleGraph.getModuleByEtag(ifNoneMatch)
55
- if (moduleByEtag?.transformResult?.etag === ifNoneMatch) {
+ if (
56
+ moduleByEtag?.transformResult?.etag === ifNoneMatch &&
57
+ moduleByEtag?.url === req.url
58
+ ) {
59
// For CSS requests, if the same CSS file is imported in a module,
60
// the browser sends the request for the direct CSS request with the etag
61
// from the imported CSS module. We ignore the etag in this case.
0 commit comments