Advanced Basics: Using Task Runner in Visual Studio 2019
Failed to run "C:\workspace\Company\Finland\tow\develop\Source\EdenredFi.WOTWeb\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
'gulp' is not recognized as an internal or external command,
operable program or batch file.
Advanced Basics: Using Task Runner in Visual Studio 2019
If the world is running on JavaScript, why not automate your client-side tasks through Visual Studio's Task Runner?
With JavaScript as currently the primary language for developers, it made sense when Microsoft released Visual Studio 2019 to include client-side tools to simplify the JavaScript development process.
One of those tools was a Task Runner.
When the Task Runner was introduced, developers of the C# community never even knew what it was or how it worked (including me).
Now, since I've dug into it, it proves it's another great tool in the DevOps toolbelt.
What is a Task Runner
A Task Runner is a tool to automate repetitive client-side tasks.
The tool runs off of a configuration file (either Gulp or Grunt) to execute on any number of static assets in a directory.
For this post, we'll focus on using Gulp with a gulpfile.js
.
Setting up the Task Runner
In Visual Studio 2019, confirm you are running the latest Node version.
- Download the latest version of Node and install it normally.
- In Visual Studio, go to Tools, Options.
- Expand the Projects and Solutions, Web Package Management, then External Web Tools.
- Confirm $(PATH) is at the top of your "location of external tools"
If you installed NodeJs properly, it will be in your system path. The $(PATH) will point to that when a build process occurs.
Next, since a Task Runner uses Node for it's engine, we need a populated package.json
file to hold the installed packages used in our Task Runner.
For starters, let's install our Gulp package.
- Open the Package Manager Console (View / Windows / Package Manager Console)
- Change into the directory containing the root of your solution.
- Type:
npm install -g gulp
Examine the package.json file in the directory. It should contain a gulp entry:
"gulp": "^4.0.2"
Once we have our package installed, we can use it in our test.
Task runner explorer可以在View-->Other windows中找到。
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2019-08-12 HearthBuddy炉石兄弟 如何调试ai
2019-08-12 How to get full path of StreamWriter
2019-08-12 No suitable constructor was found in NUnit Parameterised tests
2015-08-12 Duplex Service in WCF(CodeProject上的)
2015-08-12 wcf双工通讯遇到的问题
2015-08-12 Duplex Services (Msdn)
2014-08-12 通过第三方软件打开sqlite