Skip to content
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 an option for compile-on-save to trigger VS pre- and post-build events #2252

Closed
rotemdan opened this issue Mar 7, 2015 · 1 comment
Closed
Labels
Declined The issue was declined as something which matches the TypeScript vision Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio

Comments

@rotemdan
Copy link

rotemdan commented Mar 7, 2015

I have a TS project that's compiled to a single file, where I need to append some additional code to the resulting combined file. I added a VS post-build action to perform the processing every time I build the solution. It works fine when Build -> Build Solution (F6) or Build -> Rebuild Solution are used, but not following a compile-on-save, leading to the resulting .js file missing the expected additional code.

My current workaround is using a Grunt script that monitors the compiled .js file for changes and executes whenever it's modified. This might work fine for post-build actions in most cases (except perhaps in situations requiring tight VS synchronization with build start/completion) but doesn't support pre-build actions and generally isn't very elegant as it requires maintaining an additional background process.

It would be useful to have an option (which may or may not be enabled by default) to trigger the pre- and post-build events with this compilation method as well.

This (optional) behavior could be extended to other compiled-on-save languages such as LESS, SASS, Coffeescript etc. (though in these cases it's probably more of a Web Essentials suggestion).

@rotemdan rotemdan changed the title Add an option for compile-on-save to invoke VS pre- and post-build events Add an option for compile-on-save to trigger VS pre- and post-build events Mar 7, 2015
@mhegazy mhegazy added the Suggestion An idea for TypeScript label Mar 8, 2015
@mhegazy mhegazy added the Visual Studio Integration with Visual Studio label Dec 9, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Dec 9, 2015

Your current workaround would be my recommendation here. Using the a build tool like grunt or gulp and/or watcher should achieve the described scenario. The other option is to use the single file generator. this gives the maximum flexibility and allows for different ways of composing the events that should occur on save.

@mhegazy mhegazy closed this as completed Dec 9, 2015
@mhegazy mhegazy added Declined The issue was declined as something which matches the TypeScript vision Out of Scope This idea sits outside of the TypeScript language design constraints labels Dec 9, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Declined The issue was declined as something which matches the TypeScript vision Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests

2 participants