Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
buildOnSave support in tsconfig.json #7091
My use case is this:
I have a web app which has been built using TypeScript (since TS was 0.9!) The older part of the codebase works and uses global scope with namespaces and is written in ES5. The newer part of the codebase is written using ES6 / modules and is compiled using Webpack with ts-loader and babel-loader.
Each part of the code base is driven by a separate
So if I turn it off I have to manually run
A few notes, CompileOnSave (in VS 2015) already compiles all files in your project. We have no plans of supporting a watch mode in VS, tsc --w should be sufficient, as well as existing build tool integration.
Since you have other build steps, i am assuming you have some build system already wired in, so why not just use a watch capability in your build system. like gulp watch for instance?
Also, why not just put
Are you saying that having
For now we've been deactivating all compilarion with
Rather quirkily we're having to include to nuget TypeScript target in the
I'm just looking for VS to be a straight TypeScript editor really. However it's not easy. It feels like you have to "trick" the tooling into doing what you want.
BTW we are using watch modes when we're running in debug (not triggered as part of the vs build though)
that is not the case. I miss understood your original post. sorry about that. the "onSave" part through me off. i think i understand the issue now. let me reiterate it to confirm, you want to have a way to not build a tsconfig.json when you have multiple tsconfig.json in one project.
if so, i think you can do this by excluding the tsconfig.json from your project. the MSBuild targets enumerate them from the project. we can add a property on the item to "ignore" it, as well.
The tools look for a property
Didn't work I'm afraid. Removing
So it looks like the ability to control overall build from
Also, it's necessary to have TypeScript targets in your
Since I had a rather tricky time getting my workflow up and running in Visual Studio I decided to write it up in case others are in a similar spot. It can be found here: http://blog.johnnyreilly.com/2016/02/visual-studio-tsconfigjson-and-external.html
If I'm offering any bad advice then do feel free to set me straight. Corrections are always welcome
For what it's worth I've got a workflow that seems okay. I think the number of hoops that had to be jumped through is a shame but I'm glad that using Visual Studio for more than vanilla TypeScript scenarios now seems to be possible. I think it could really benefit from being easier though.