-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
isolatedModules - potential issue with @types? #16351
Comments
Essentially errors pointed out by isolatedModule would block a reliable emit on a file by file basis i.e. using So by Example:
Because we need to emit PS: Always a please to hear from you @johnnyreilly ❤️ 🌹
My dream (might not be valid) would be that isolatedModules has no effect on |
@Andy-MS we should not check this if we are in ambient context, regardless of the compiler options. |
Thanks for advising @basarat - as helpful as ever! 💓 So it seems like I have Following your explanation I'm now curious; do you know of a good use case for |
True.
If you know you are going to compile your code using |
Cool - thanks 🌷 BTW ts-loader uses |
Its the same. |
Sweet - you are a fount of knowledge! |
If code is written to comply with |
Hello!
I'm one of the maintainers of ts-loader, a TypeScript loader for webpack. We've recently been doing some work to improve performance by switching ts-loader to
transpileOnly
mode and using the fork-ts-checker-webpack-plugin to perform type checking in a separate process.As a further optimisation we've been thinking about making use of the
isolatedModules
flag to make ts-loader do even less work. However when testing this out @odensc has stumbled upon this error:I wanted to raise this to check if there some kind of issue using
isolatedModules
in conjunction with @types?Also, I wanted to request guidance on use of
isolatedModules
- there isn't much documentation on the flag that I've been able to find. Will setting the flag totrue
affect the experience of users in vscode / visual studio / alm-tools etc? Will less errors etc be reported if this flag is set?I ask as, historically, ts-loader has used the
tsconfig.json
as is and has done no "magic" with it. However, if by settingisolatedModules
totrue
then we degrade the IDE experience then I can see a reason for deviating from this. i.e. Having ts-loader settingisolatedModules
totrue
internally if a certain ts-loader config option is set. But is this necessary? Does this flag have any bearing on the IDE experience? I simply don't know at present I'm afraid.cc @jbrantly @piotr-oles @odensc @basarat
Possible related issue: #2812
The text was updated successfully, but these errors were encountered: