You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add an option for compile-on-save to trigger VS pre- and post-build events #2252
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).
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[/+]on Mar 7, 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.
Activity
[-]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[/+]mhegazy commentedon 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.