问题
I've just start playing with grunt for visual studio and I can't figure out how to run particular tasks depending on configuration (debug, release, etc).
You can run tasks before build, after build, etc. But how to bind it to the configuration?
回答1:
This Question might help.
On top of that I added this:
cd "$(SolutionDir)\CustomerService\Resources\build\node_modules"
call grunt.cmd chatStyling --buildConfiguration=$(ConfigurationName)
to my pre-build events. (Note that chatStyling
is a custom task.)
回答2:
<shameless-plug />
I do this using VsCommandBuddy extension for vs2013/vs2015. Using the configurationname in a macro as parameter for the command you'd like to execute.
来源:https://stackoverflow.com/questions/28706830/visual-studio-grunt-run-tasks-depending-on-configuration