Gulp Tasks - SharePoint/PnP-JS-Core GitHub Wiki

This page outlines the available gulp tasks in the project, what they do, and how to use each. As of 2.0 an effort has been made to simplify the tasks and group things more appropriately.

gulptasks/@Configuration.js

This is not a task but rather contains all of the settings used by the tasks. You can see all of the globs and output folders as well as the library header and other settings.

build

gulp build

This task will generate the /lib folder based on the settings in tsconfig.json. The transpiled JavaScript files as well as the corresponding d.ts files will be produced. This task is used when creating the NPM release packages and it is unlikely you will need to use it directly.

clean

gulp clean

Deletes all of the folders generated by other tasks which are not part of source control.

lint

gulp lint

Runs linting against the files in the src folder based on the rules in tslint.json. You should run this before submitting a PR to ensure the code meets the defined standards.

package

gulp package

Package the solution by building the /lib folder and then using webpack to bundle the library into individual UMD module files as defined in webpack.config.js.

serve

gulp serve

Uses the webpack development serve to bundle, watch, and serve the package based on the settings in webpack-serve.config.js. Please see the debugging article for details on using this command to debug within the browser or SharePoint Framework project.

sync

gulp sync

Build and then copies the *.js files from the /dist folder to your SharePoint site as defined in the settings.js file. You can create this file by making a copy of settings.example.js and renaming it.

test

gulp test

// or to run a single set of tests use the --single flag and the path to the module
gulp test --single sharepoint/rest/lists

// you can also determine if you want the full code coverage table, now hidden by default
gulp test --coverage-details

Runs the defined tests against the code. Web tests are enabled by updating the "enableWebTests" flag in the settings.js file.