-
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
base: release/15.0.0
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
feat/wbip_full_resolve_ts_config
|
Run status |
|
Run duration | 20m 17s |
Commit |
|
Committer | Jennifer Shehane |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
4
|
|
27
|
|
0
|
|
749
|
View all changes introduced in this branch ↗︎ |
UI Coverage
62.34%
|
|
---|---|
|
27
|
|
48
|
Accessibility
96.16%
|
|
---|---|
|
0 critical
4 serious
1 moderate
0 minor
|
|
119
|
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)
c61cca7
to
4e6f117
Compare
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
4e6f117
to
499c559
Compare
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.
Tested the situation before and it works more as expected. Tested some other situations - that the tsconfig is being read it properly with it preferring the cypress dir tsconfig.
…ully resolve the user tsconfig compiler options throw an error if typescript is installed, but a tsconfig.json cannot be found empty commit to run ci
e458cbc
to
74531f0
Compare
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
?