Custom Gulp tasks in SharePoint Framework (SPFx) Solution

Hi Friends,

There are many scenarios where we need some custom task to be performed and would prefer to perform that task as automation process. A very good example that i remember right now is the updating the version in the config.json before creating the package. It is very common to forget to update the package and then we need to build the solution again as the changes will not reflect if the version is not increased..
So here I'll guide how you can create our own gulp task and make most of the work automated by writing simple commands.

I this example i will be updating the minor version if the mode is debug else major version will be updated. Secondly, if the build is SHIP then it will compile and also build the packages. So in short you only need to execute a single command to perform all the actions at once.

The below code creates a task by the name 'createPackage' and describes the execute command

Happy Coding 🎺
Sumit Kanchan


Popular posts from this blog

Rename Folder using Microsoft Flow / Power Automate in a Document Library in SharePoint Online

Power Automate: How to Add "New Line" to the text in SharePoint multiline text field

Power Automate: Rename file in SharePoint Online