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: fix preTransformRequests #19272

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Jan 23, 2025

Description

reproduction: https://github.com/hi-ogawa/reproductions/tree/main/vitest-7345-preTransformRequests-false

  • Vite 5
$ ssr=true preTransformRequests=true node repro.js
>>> transformRequest("/src/entry.js", { ssr: true })
[transform] entry.js
[transform] dep.js

$ ssr=false preTransformRequests=true node repro.js
>>> transformRequest("/src/entry.js")
[transform] entry.js
[transform] dep.js

$ ssr=true preTransformRequests=false node repro.js
>>> transformRequest("/src/entry.js", { ssr: true })
[transform] entry.js

$ ssr=false preTransformRequests=false node repro.js
>>> transformRequest("/src/entry.js")
[transform] entry.js
  • Vite 6
# ⚠️ `server.preTransformRequests: true` doesn't enable ssr pre transform
$ ssr=true preTransformRequests=true node repro.js
>>> transformRequest("/src/entry.js", { ssr: true })
[transform] entry.js

$ ssr=false preTransformRequests=true node repro.js
>>> transformRequest("/src/entry.js")
[transform] entry.js
[transform] dep.js

$ ssr=true preTransformRequests=false node repro.js
>>> transformRequest("/src/entry.js", { ssr: true })
[transform] entry.js

# ⚠️ `server.preTransformRequests: false` doesn't disable client pre transform
# (this is  the case which affects Vitest jsdom)
$ ssr=false preTransformRequests=false node repro.js
>>> transformRequest("/src/entry.js")
[transform] entry.js
[transform] dep.js

@hi-ogawa hi-ogawa force-pushed the fix-server-preTransformRequests-compat branch from 5c35f99 to 97d7f6e Compare January 24, 2025 09:36
@hi-ogawa hi-ogawa changed the title fix: backward compat for server.preTransformRequests fix: fix server.preTransformRequests Jan 24, 2025
@hi-ogawa hi-ogawa changed the title fix: fix server.preTransformRequests fix: fix preTransformRequests Jan 24, 2025
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.

How to disable Pre-transform error log?
1 participant