-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: allow for @cypress/webpack-batteries-included-preprocessor
to fully resolve the tsconfig.json
for compilerOptions
in ts-loader
(v15)
#31590
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
Open
AtofStryker
wants to merge
3
commits into
release/15.0.0
Choose a base branch
from
feat/wbip_full_resolve_ts_config
base: release/15.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a65ff55
to
0bc3d98
Compare
7007730
to
fe0e7c6
Compare
6ed4b6e
to
fe0e7c6
Compare
@cypress/webpack-batteries-included-preprocessor
to fully resolve the tsconfig.json
for compilerOptions
in ts-loader
@cypress/webpack-batteries-included-preprocessor
to fully resolve the tsconfig.json
for compilerOptions
in ts-loader
b7a62ac
to
61055e6
Compare
@cypress/webpack-batteries-included-preprocessor
to fully resolve the tsconfig.json
for compilerOptions
in ts-loader
@cypress/webpack-batteries-included-preprocessor
to fully resolve the tsconfig.json
for compilerOptions
in ts-loader
(v15)
…ully resolve the user tsconfig compiler options
c61cca7
to
4e6f117
Compare
jennifer-shehane
requested changes
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered an unusual error with a project with a ts file and no tsconfig that requires looking into. Slack thread
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fully resolves the user tsconfig compiler options instead of trying to infer the
tsconfig.json
implicitlyts-loader
in@cypress/webpack-batteries-included-preprocessor
should respect all user compiler options #31282Additional details
Passes in the discovered user's
tsconfig.json
compilerOptions
from thecypress/
directory intots-loader
. This change is intended to give users more power of the cypress webpack preprocessor.This is being flagged as a feature here, but is considered disruptive as it means users need to fully specify their
tsconfig.json
compatibility to work correctly with Cypress. This can be seen with themoduleResolution: "node"
updates in@cypress/webpack-dev-server
and@cypress/vite-dev-server
as the default resolution is "classic" and doesn't work with "resolveJsonModule". For most user's, this should be a passive change.Regardless of passed in options,
sourceMap=true
is always overridden in the@cypress/webpack-preprocessor
since Cypress needs source maps to deliver accurate snapshots and code frames.Steps to test
use the pre-release binaries in 484c2eb#comments to run against some sample
tsconfig
s in thecypress/
directory of your project. If you runDEBUG=cypress:webpack-batteries-included-preprocessor npx cypress open
you should now be able to see whichtsconfig
compilerOptions
are being passed in.How has the user experience changed?
Previously,
@cypress/webpack-batteries-included-preprocessor
would usets-loader
without specifying any type ofcompilerOptions
, which will try to imply thecompilerOptions
from the relatively resolvedtsconfig.json
of the file/process, which may not be correct as we want to use the definedtsconfig.json
in thecypress/
directory, or project root if one does not exist.With this change, we are now make sure to use the user's defined
tsconfig.json
compilerOptions
to process the file.Additionally, if processing TypeScript files without a
tsconfig.json
in the project root or in the cypress directory, the preprocessor now throws an error. This is to improve the error thrown in #18938, but does not completely close the issuePR Tasks
cypress-documentation
? chore: update typescript docs to tsx cypress-documentation#6155type definitions
?