-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Add no-compile option to tsconfig #2326
Comments
You mean full build not compile on save right? Compile on save is already toggleable in VS and using (or not using) --watch on the command line. It sounds like you want something similar to this #2294 but provided in tsconfig? |
Yes, that's what I meant. It should be something like |
Your IDE build is triggered by the msbuild targets in your project file. if you want to stop that, open your project file, and comment out the reference to Microsoft.TypeScript.Targets, and no build will occur. no need for a different file here :) |
@mhegazy Unless someone else in your team uses another editor, like Atom. You can disable it in Atom, but defining it once in tsconfig would be better. |
Related: TypeStrong/atom-typescript#175 and ivogabe/gulp-typescript#65 |
As I understand it this switch would support those users who are using Gulp or Grunt to do their TypeScript compilation and they don't want Visual Studio / atom-typescript / sublime etc to get involved in doing a build. As @mhegazy says we can already cater for this in Visual Studio by tweaking the project file. As regards atom-typescript etc I understand there's a an agreement that we can extend the That being the case I'm not sure this needs an official @basarat - do you have a view on this? |
@johnnyreilly That's a good summary. There is a big advantage for this to be official, since if it's official, all editors should support it. That makes it easier for these users: they can configure this option once and it will be disabled in all editors. That's very useful if you have a big team or an open source project. |
I'm inclined to agree. If enough people want this in enough different scenarios then there's value in just standardizing the name of the flag rather than having some people use |
I recommend 👍 on moving this into tsconfig.json. I'll do that. PS: Having a negative like |
@basarat I chose for |
I specifically want to disable "compile" OnSave. For Atom-TypeScript build is an explicit option triggered by the user. If they don't trigger it, it doesn't happen. Compile on save is what happened as a side effect of saving and so it needed configuration. I guess you want to disable all IDE compile. That seems like a Visual Studio / exclude from MSBuild problem, not related to other other IDEs. At the very least don't see it as an option we need to read in Atom-TypeScript. |
@ivogabe perhaps |
@basarat Do you mean adding two different options to tsconfig.json? I think it would be better to make these two one, especially because many (all?) users want to enable them both, or disable them both. I think disabling a build option hidden in a submenu isn't a problem, since setting this option means you shouldn't compile TypeScript from an editor since a build system should do that. |
I agree. |
I think |
I previously went with After discussion with @Zoltu here TypeStrong/atom-typescript#324 I'll be moving to : "ide": {
"compileOnSave" : boolean
} Please leave a comment if you disagree. Note that in my opinion |
After letting it sit in my brain I dislike my proposal. Perhaps for the user the option is important for gulp to read. Really it belongs in something like "atom" key and then the user should lookup what options are supported by their ide / build tool. At the moment I'll leave the options I have as they are. If I do something wonky (tsconfig for me has been fairly stable) I'll do it under atom from this point on. |
Does not seem that there is an action item here per se. switching it to discussion from suggestion. |
For VS 2015 we have included the TypeScriptCompileBlocked msbuild element, this will block tsc from being invoked during a build. |
Any progress on this? I'm using Atom and bundle my code with webpack. |
@gyzerok Atom-typescript has an unofficial extension to tsconfig.json for this: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#compileonsave |
@nycdotnet thanks bro! |
|
Sounds like something that would be more appropriate in something like |
Just a quick comment on this - it looks like much of the conversation here is centered around enabling/disabling compile-on-save for all typescript in a project - i.e. on the use case where only one tsconfig.json exists in the project. However, that's not the only use case for this: In my case, I have more than one tsconfig.json within a single Visual Studio project, with one specifying compile options for the app code, and another for compiling some custom tslint rules. I just wanted to point out this use case, so it doesn't get lost in the conversation :-) |
After discussing this with @paulvanbrenk, VS should honor the |
Yay! |
|
I've been experiencing difficulties with it... See #6782 |
.njsproj files also work for TypeScriptCompileBlocked. See also https://shauntm.com/notes/entries/231 |
How about compile on save for just some files? my files should not be compiled on save as I use gulp to do that. but I actually write my gulpfile as a typescript file and I need that file to compile on save. |
have to tsconfig.json files, one at the root for your gulpFile, and one in a source directory for your sources. the top one allows compile on save, the other one does not. regardless, i do not think you can rely on compile on save for your gulp file, as you want it to run on a CI server for instance that does not have an editor. consider using something like |
Some users want to use the built-in compilation of their IDE, but some want to use grunt or gulp. If you want to use grunt or gulp for compilation, you need to disable compilation in your IDE. Since a big team can use multiple IDEs, I think this should be implemented in
tsconfig.json
.Suggestion: Add a new option to
tsconfig.json
to disable the compilation in the IDE ("compile on save"), which defaults to false.Example:
If an IDE finds a config file with this option, it shouldn't compile the project, but it should give auto completions, type errors, etcetera. If a build tool sees this option it should ignore it, because you use an IDE always for writing, sometimes for building and you use a build system always for building.
The text was updated successfully, but these errors were encountered: