我们搬到了visual studio,我们在使用TFS和我的gulp构建过程时遇到了一些问题。
在TFS中,我们在生产之前有开发和测试环境。 现在我的问题是,在更改本地代码之后如何在.csproj中运行gulp task(gulp dev)作为一个所以我可以在mainlayout.cshtml中为dev和路径更改创建main.css?
例如:我在本地更新了event.scss,它将修改我的本地main.css(不在TFS和Project中 - 所以我们不会得到权限问题)。从TFS办理登机手续后,我必须为dev创建main.css,以便在dev环境中进行渲染。 我知道它是由构建经理完成的,但"如何?"我不知道。
如果可以,请帮助我。 :)
提前致谢!!!!
答案 0 :(得分:4)
您可以使用Exec任务运行gulp,例如:
<Target Name="BeforeBuild">
<!-- Is node installed? -->
<Exec
Command="node || start http://nodejs.org && echo You need to install NodeJS" ContinueOnError="false" />
<!-- it is, so have npm install all dependencies -->
<Exec
WorkingDirectory="$(ProjectDir)"
Command="npm install"
ContinueOnError="false" />
<!-- npm installed bower for us, so now let bower install it's dependencies -->
<Exec
WorkingDirectory="$(ProjectDir)"
Command="node_modules\.bin\bower install"
ContinueOnError="false" />
<!-- run the gulp task for the appropriate configuration -->
<Exec
WorkingDirectory="$(ProjectDir)"
Command="node_modules\.bin\gulp $(Configuration)"
ContinueOnError="false" />
</Target>
查看this文章。