-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Referenced file is included even if its in the tsconfig exclude list #15417
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
Comments
Thanks for response. Is there any way how to get around it? Because I need to reference the file in order it is included in the generated js before functions are used. |
Would having different tsconfig.json files based on the setup be a possibility? |
I am sorry, I don't see the idea. It probably would be possible but it also would be less comfortable for developers than the current solution. |
Configuration inheritance can simplify the process. |
otherwise, #3538 might be what you are looking for. |
Thats exactly what I am doing. I inherit tsconfig.json from tsconfig.Debug.json which inherits tsconfig.Common.json. It works well until there is <reference path... inside of one of .ts files as exclusion of that referenced file is not taken into account. We should be able to conditionally exclude reference in my opinion. #3538 does not help at all. |
do not mix references and tsconfig files. that would be my recommendation. |
Anybody has an idea how to get around this problem? |
Nobody was trying to solve this issue? Omg :) |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.2.1 / Visual Studio Extension
Hello,
I would like to ask why referenced file is included to the compilation all the time even if it excluded in the tsconfig.
I am doing something like this:
I have 4 tsconfig files:
and simply contains just:
so I can do a conditional compilation of the project files, because I am also specifying in
tsconfig.Debug.json
tsconfig.Release.json
so basically all files with .Release.ts extension are excluded during the debug build and vice versa.
The problems comes when I have i.e. file with constants (this is just example) such as
constants.Debug.ts
constants.Release.ts
which I am referencing in another file:
Expected behavior:
I would expect that one of referenced files will not included to the project compilation (based on the build configuration) as it is excluded in the tsconfig
Actual behavior:
Both files are included so "Cannot redeclare block-scoped variable..." error is shown.
The text was updated successfully, but these errors were encountered: