Update to my Azure Pipelines Templates for SPFx Projects (v1.3.0)

I’ve updated our Azure Pipelines Templates for SharePoint Framework projects earlier today. This release, v1.3.0, includes a few improvements and updates.

These updates are packed into two releases, v1.2 & v1.3. They are broken up so if you aren’t interested in v1.3, you can configure your pipeline to use just the 1.2 release which includes a specific fix / enhancement.

What’s new

The two releases include three updates & two minor changes to the project. If you want to use the latest version of the templates in your pipelines, just reference the repo as you’ve done in the past. This will default to the master branch.

If you want to use a specific version, update your pipeline reference to the template project to point to the v1.3 tag. For example:

# azure-pipelines.yml
  - repository: azure-pipelines-spfx-templates
    type: github
    name: voitanos/azure-pipelines-spfx-templates
    ref: refs/tags/v1.0.3
    endpoint: github

Learn more how to reference specific versions in the project’s readme: Consider Referencing Specific Template Versions

I recommend you point to a specific version of these templates in your pipeline and not rely on what’s in master. This insulates your pipeline from any changes that are pushed into the latest release. From my point of view, changes external to your project shouldn’t impact your pipeline.

Specify Node.js version to use

Previously in v1.1, the templates all used the version of Node.js that was installed on the agent your jobs ran on. This works fine, except for those cases where developers need a specific version.

By default, the templates use Node.js v10, the recommended version to use with SPFx in SharePoint Online. You can change the version of Node for the build & test templates with a new parameter node_version.

This is the only update in v1.2 .

Update the package install commands to use CI commands

Previously in v1.1, the templates used the default install commands for the package manager (NPM, Yarn, or PNPM). These work fine, but package managers have introduced special commands for CI scenarios that ignore the package.json file and only look at the package manager lock files.

Your project must have a lock file for the package manager you want to use going forward.

This update is available in v1.3 .

Updated templates to use the Gulp v1 task

All templates that use the Gulp Azure Pipeline task have been updated to use v1 instead of v0. I was using v0 to get around a bug I reported that has since been fixed.

This is transparent to your pipeline… there’s nothing for you to do. This update is available in v1.3 .

Updated a renamed PNPM argument

The command-line argument required for SPFx projects, –shamefully-flatten, was renamed to –shamefully-hoist, due to a change by PNPM.

This update is available in v1.3 .

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.