
This post will assist anyone wanting to develop Rust applications using Visual Studio Code (VS Code) as of 2020. If Visual Studio Code is your editor of choice, refer to this post on Microsoft's site.ĭo you have a favorite Gulp or Grunt task? How many tasks run through your Task Runner? Post your comments below and let's discuss.Rust has been gaining popularity and is seeing tremendous adoption amongst developers. While bundling and minifying are the basics when using a Task Runner, there are a ton of other tasks available including minifying HTML or optimizing your images to make them smaller and load faster.Īlways be mindful when automating your tasks to find the right balance between fast tasks and useful client-side tasks. In today's post, we took a simple tool and automated tasks to make our life a little easier. This gives you a simple way of minifying your JavaScript and placing it into a run-time folder.
Create a gulpfile.js in the root of your project with the following contents. Think of it like a "Hello World" for our Task Runner. One of the best ways to test it out is to create a simple task. Once we have our package installed, we can use it in our test. It should contain a gulp entry: "gulp" : "^4.0.2" Change into the directory containing the root of your solution.Įxamine the package.json file in the directory. Open the Package Manager Console (View / Windows / Package Manager Console). 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.įor starters, let's install our Gulp package. The $(PATH) will point to that when a build process occurs.
If you installed NodeJs properly, it will be in your system path.
Confirm $(PATH) is at the top of your "location of external tools". Expand the Projects and Solutions, Web Package Management, then External Web Tools. In Visual Studio, go to Tools, Options. Download the latest version of Node and install it normally. In Visual Studio 2019 (or 2022), confirm you are running the latest Node version. The tool runs off of a configuration file (either Gulp or Grunt) to execute on any number of static assets in a directory.įor this post, we'll focus on using Gulp with a gulpfile.js. What is a Task RunnerĪ Task Runner is a tool to automate repetitive client-side tasks. Now, since I've dug into it, it proves it's another great tool in the DevOps toolbelt. When the Task Runner was introduced, developers of the C# community never even knew what it was or how it worked (including me). With JavaScript as currently the primary language for developers, it made sense when Microsoft released Visual Studio 2019 (or more recently Visual Studio 2022) to include client-side tools to simplify the JavaScript development process.