Posts

Showing posts with the label gulp task

How to resolve certificate issue in SharePoint Framework Solution

Image
Hi Friends, Today i will be discussing about the certificate issue when we run the gulp command and try to run the SharePoint Framework Solution in local workbench. Issue: Warning - [spfx-serve] When serving in HTTPS mode, a PFX cert path or a cert path and a key path must be provided, or a dev certificate must be generated and trusted. If a SSL certificate isn't provided, a default, self-signed certificate will be used. Expect browser security warnings . If you read the issue , the issue is that it does not find the certificate that shows trust in the URL you are accessing, because of which you see the following message on the screen. Solution: So here is the simple solution and you won’t experience this issue any more. In your solution open the node command prompt. If you are working in Visual code then open the solution and then press the ~ + Cntrl . Now follow the 2 steps: Execute the command gulp trust-dev-cert Click Y...

Custom Gulp tasks in SharePoint Framework (SPFx) Solution

Image
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