sp-build-tasks

👷 SharePoint front-end projects automation and tasks tool-belt

NPM

npm version Downloads Build Status FOSSA Status Gitter chat

banner

The library was designed for usage with SharePoint Push-n-Pull Yeoman generator but can be used as a stand-alone package as well.

Install

Dependency

Integration to the code

Settings

Parameter

Description

privateConf

path to credentials config file

appConfig

path to application config file

taskPath

path to custom gulp tasks folder

App config file

The app config file should be a JSON document with the following schema sp-build-tasks/schema/v1/sppp.json.

The schema represents the following interface:

Custom Gulp tasks

or types supported version:

Gulp tasks

Authentication config setup initiation

Populates ./config/private.json with credentials options.

Watch and live development

Watch

Watch for changes in ./src folder, compiles .ts, .hbs and .scss to ./dist. Watch for changes in ./dist and uploads to target SharePoint folder.

Watch with SharePoint pages live reload

Does the same as the watch task. Emits files update to SharePoint live reload client which triggers live pages reload for:

  • JavaScript's updates

  • CSS's updates

  • CEWPs updates

  • Layouts updates

  • Masterpage updates

Syncronization

Publishing ./dist to SharePoint

Publishes all ./dist folder content to SharePoint target folder.

Publishing in incremental mode

Uploads only files which size is different from those in SharePoint.

Fetching files from SharePoint

Downloads all files and folders from remote SharePoint target to ./dist folder.

Build front-end

Compiles front-end to ./dist folder.

Build options

Production build

Used with Webpack build.

Build subtasks

A specific subtasks can be provided as gulp build parameters:

Parameter

Description

--webpack

webpack'ing .ts to single app.js buldle

--css-custom

bundling custom css (from .scss)

--copy-assets

copying static content

--js-libs

bundling JavaScript libraries

--css-libs

bundling CSS libraries or custom .css

--masterpage

.hbs to .masterpage

--layouts

.hbs to .aspx layouts

--webparts

compiles .hbs CEWPs

Starts webparts and webpack tasks, also uses production build configs.

Deployment

Live reload

Installs live reload client as ScriptLink custom action to SPWeb.

Retracts live reload custom action client.

Masterpage

Applies custom masterpage and logo to SPWeb.

Restores default (seattle.masterpage) masterpage.

Custom actions

Provisions custom actions from app.json settings.

Removes custom actions based on project namespace prefix.

Configuring CI/CD

Checkout this end-to-end sample.

License

FOSSA Status

Last updated

Was this helpful?